Hi folks, this is my first post here and I am a first time user running Tiny Core installed to a VirtualBox VM.
I ran into a problem while writing a script that will format a USB mounted SD card with four partitions, and then copy files over to each of the partitions.
I'm doing the following in a sh script:
dd if=/dev/zero of=$DEVICE bs=1024 count=1024
{
echo ,9,0x0c,*
echo ,$(expr $CYLINDERS / 4),,-
echo ,$(expr $CYLINDERS / 4),,-
echo ,,0x0c,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DEVICE
# creates four partitions
mkfs.vfat -F 32 -n boot ${DEVICE}1
mkfs.ext4 -L rootfs ${DEVICE}2
mkfs.ext4 -L userdata ${DEVICE}3
mkfs.vfat -F 32 -n other ${DEVICE}4
mount ${DEVICE}1
cp ~/files/* /mnt/$MOUNT
umount ${DEVICE}1
This gives the error
mount: can't find /dev/sdb1 in /etc/fstab
cp also says that there's no space left on the device.
I know this approach works on other distros, and I'm thinking maybe in this case fstab isn't being updated before I try to mount the new partitions. I searched for hours and can't really find what I'm looking for.
So I guess my question is, how can I refresh or regenerate fstab so that I can mount newly created partitions?
Many thanks in advance,
Bruce