I'm trying to add lines to my /etc/fstab file.
but the lines I add get cleared on reboot because I am using a persistent live USB stick.
I don't want a lecture. I just want to know which file writes the /etc/fstab file at restart and I want to alter that file so that I can auto mount the disk I want.
So this is not really a question but more like a request.
I am requesting the location of the file/files that are responsible for writing to or resetting /etc/fstab on restart.
3 Answers
For my LiveUSB install with Ubuntu 11.10 (which has a casper-rw persistence loopback file), the file that worked for me to have drives mounted automatically is:
/usr/share/initramfs-tools/scripts/casper-bottom/12fstabI added lines into that script which worked to add new drive mounts upon boot-up. The odd thing is that my /etc/fstab file does NOT reflect the drive mounts. This would seem to suggest that the /etc/fstab file is just a dummy file or something to the LiveCD setups. Not sure, but changes added to the 12fstab file DO persist.
Add your mount commands in /etc/rc.local
...
mount -t ntfs-3g -L Inter /media/Inter -o uid=1000,gid=999,umask=002
exit Rather than use a live media with persistence, I always simply install directly to the flash drive. This way any changes I make are kept. Whether the changes are to the data stored there or the system configuration or applications I have installed is irrelevant with this approach. If you still need the live media for installation purposes you can put a copy of the ISO on the stick and boot it as needed as outlined here.