Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
I was able to add the line "gksu mount /dev/sda2 /media/Windows" to my startup apps program and it seems to work fine but I still wish I could get fstab working. –  Joshua Robison Aug 11 '11 at 19:26
    
Are you sure it is reset, and not just ignored? I would think it would just be ignored, because the new version saved in the persistence file is not used until after the original fstab is processed. –  psusi Aug 11 '11 at 19:30
    
Maybe you will have to make a customized live-usb. See this: forums.debian.net/viewtopic.php?f=17&t=59876 –  desgua Aug 12 '11 at 0:11
    
@psusi, nope, not ignored because when I reboot I reopen fstab and the line I entered is gone. –  Joshua Robison Aug 12 '11 at 11:07
    
this is amazing that a simple file that resets the fstab can't be found O_o it has to be just a simple shell script somewhere. –  Joshua Robison Aug 13 '11 at 13:03
show 2 more comments

2 Answers

up vote 3 down vote accepted

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/12fstab

I 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.

share|improve this answer
    
This seems to be outdated. Well at least it didn't work for me. I added a line to /etc/fstab of my live system and tested it with sudo mount -a. It worked. Then I added the same line at the appropriate place in /usr/share/initramfs-tools/scripts/casper-bottom/12fstab and rebooted. No effect. Might be that the mount point was bad or something - need to test that. –  con-f-use Aug 28 '12 at 12:02
add comment

Add your mount commands in /etc/rc.local

...
mount -t ntfs-3g -L Inter /media/Inter -o uid=1000,gid=999,umask=002
exit
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.