Demorou um pouco para encontrar uma solução. Não tenho certeza se essa é uma maneira adequada e conveniente de fazer isso, mas funciona para mim.
O script a seguir fará a formatação e montagem automatizada:
#!/bin/bash
# search the device name 'ANS9010_22222222' and construct the path to it
DEV='/dev/'$( lsblk -n -o name,MODEL | grep ANS | cut -f 1 -d ' ' )
echo $DEV # this schould give something like /dev/sda
# This is now specific to the device
# set the disc label
parted -s $DEV mklabel msdos
# make the partition
parted -s $DEV unit kB mkpart primary 34 100%
# now we have to work with the 1st partition e.g. /dev/sda1
# so we must generate a $DEVP variable
# finally initialize the filesystem and give it a name
DEVP=$DEV'1'
mkfs.ext3 -L HYPERDRIVE $DEVP
# mount it via a 3 way change of dirs
echo '+++ make-dirs +++'
# make a temporary dir for the hyperdrive and mount it to that
mkdir /tmp_hyp
echo '+++ mount +++'
mount /dev/sda1 /tmp_hyp
# move everything to /tmp_hyp
echo '+++ move +++'
mv -f /tmp/* /tmp_hyp
# unmount, clean and remount as /tmp
echo '+++ umount +++'
umount /tmp_hyp
rmdir /tmp_hyp
echo '+++ remount /tmp +++'
mount -t ext3 -o defaults $DEVP /tmp
# !! very important !! change permissions to tms's defaults
chmod 0777 /tmp
Tendo isso, devemos conseguir que esse script seja executado durante a inicialização. Como o método via rc.locale ainda é complicado, adicionar uma linha ao '/ etc / crontab' resolveu isso:
# m h dom mon dow user command
... ... ... ... ... ... ...
@reboot root /usr/local/etc/auto-format-hyperdrive.sh
O importante aqui é o usuário 'root' e o '@reboot', que informa ao cron para executar o script como root em cada reinicialização. "TaTahha" e isso funciona bem para mim.