Why does my Ubuntu Live USB stick always resets my modified fstab to "defaults"?

1

I made an Ubuntu Live USB Stick with the LinuxUSBDownload installer. The installer works great and also the well known issue of not unmounting the casper-rw at shutdown is fixed. :D

The problem now is that I have 3 partitions on my USB drive. One partition is an ext4 partition on which my personal data should be stored. I would like to have this mounted on boot, so I added these lines to fstab:

/dev/disk/by-id/usb-Kingston_DT_Ultimate_G2_0018F30C9F8ABC6081AD0090-0:0-part5  /mnt/home2  ext4  defaults  0 2

When saved mount /mnt/home2 works fine but after reboot fstab is restored to this default values:

overlayfs / overlayfs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sda5 swap swap defaults 0 0

Because of that my ext4 partition couldn't be mounted on boot. Now I thought of adding a

mount -t ext4 -o defaults /dev/disk/by-id/usb-Kingston_DT_Ultimate_G2_0018F30C9F8ABC6081AD0090-0:0-part5 /mnt/home2 

to my /etc/init.d/rc.local

But isn't there a better way to do that with fstab?

MinecraftBhil

Posted 2012-11-21T21:11:03.723

Reputation: 55

Answers

2

Edit this file here.

/usr/share/initramfs-tools/scripts/casper-bottom/12fstab

https://askubuntu.com/questions/56719/what-file-resets-fstab-on-persistent-live-environments

Zero

Posted 2012-11-21T21:11:03.723

Reputation: 136

Thank you very much!!! Works brilliant! This helps me a lot! I really would like to rate your answer up but because I'm new to superuser I'm not allowed to :( – MinecraftBhil – 2012-11-21T21:46:04.553