Raptor Computing Systems Community Forums (BETA)
Software => Firmware => Topic started by: FlyingBlackbird on January 27, 2020, 12:42:23 pm
-
How can I mount a writable USB drive? I have tried many ways (where mount is even showing rw) but the files are not stored on the drive once I plug it into another machine.
It looks like there is an transient overlay file system...
# show available devices
ls /var/petitboot/mnt/dev/
# create a mount point
mkdir /mnt/usb
# mount your usb drive
mount /var/petitboot/mnt/dev/sdb /mnt/usb-stick # is mounted read-only
I have tried various remounts, device paths, options etc. but with no success...
-
It seems I have found a solution:
https://sthbrx.github.io/blog/2016/08/17/getting-in-sync/ (https://sthbrx.github.io/blog/2016/08/17/getting-in-sync/)
The reason is a "snapshot" layer that intecepts writes into a temporary in-memory file system to support changes of mounted devices without the danger of changing them physically/permanently.
Assuming your USB drive is sda you can remount as read-write, copy files and sync the changes to the physical device like this:
mount -o remount,rw /var/petitboot/mnt/dev/sda1
cp /var/log/messages /var/petitboot/mnt/dev/sda1/
pb-event sync@sda1
TODO: I must add this to the wiki somewhere (found no good place for that ATM)