LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Issues with fstab-How not to screw it up? (https://www.linuxquestions.org/questions/linux-newbie-8/issues-with-fstab-how-not-to-screw-it-up-711558/)

linus72 03-14-2009 06:57 AM

Issues with fstab-How not to screw it up?
 
Ok-I frequently install various distro's, and although most distro's auto-detect and auto-mount swap and whatever other partitions there are, I have found that the /etc/fstab does not "auto-update" itself.
Does anyone know why?
For example, Here is my /etc/fstab for SuperUbuntu 8.10-
Code:

proc            /proc          proc    defaults        0      0
UUID=b31c0d39-40e4-4263-9be5-9c1158dff74b /              ext3    relatime,errors=remount-ro 0      1
UUID=9613045c-15c2-4567-b859-d3ba7246b409 none            swap    sw              0      0
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto,exec,utf8 0      0

As you can see it's wayyy off!
So, I need to edit it, and do it right-but I also need to fix all the others as well.
This is why my swap never works.
Also, are there other files I need to edit?
Do I need to create mountpoints? I can access all drives by manually using point and click-but not thru xterm.
Here is my HD layout-
Code:

SDA-1=Slackware-12.2(27GB)
SDA-2=Ubuntu-SE-8.04(16GB)
SDA-3=SuperUbuntu-8.10(41GB)
SDA-4=Extended (65GB)
SDA-5=GoboLinux (10.5GB)
SDA-6=Gentoo2008 (15GB)
SDA-7=Arch-'09 x86_64 (10GB)
SDA-8=Debian-Lenny (11GB)
SDA-9=Swap(2.21GB)
SDA-10=FAT32-File-Storage (17.5GB)


jschiwal 03-14-2009 07:09 AM

You have many distro's and each one has its own /etc/fstab file. IMHO, it should be a static file, but Ubuntu treats it as a dynamic one. The dynamic file is /etc/mtab which lists the mounted partitions. You other partitions will do it this way. Even Ubuntu only modifies fstab for auto-mounted drives that are added. Changing your partitioning for another distro, may not be reflected when you run Ubuntu.

Consider using the UUID or Disk-by-id in your fstab and grub's /etc/boot/grub/menu.lst files. You are probably trying out different distro's and changing your partitioning scheme often. Doing so, if you delete a partition and create two partitions in it's place, the device nodes will change and you will need to make the changes in /etc/fstab. If you use the UUID of the filesystem, it will be a constant.

Run: "udevinfo -q env -n /dev/sda6" for example to obtain the uuid number for the 6th partition. Select the line that looks like "ID_FS_UUID=8ad26259-a8b0-4b2e-b9d1-af4bdacea3c4" and use the part starting with UUID in the first column of your fstab file. I.E. "UUID=8ad26259-a8b0-4b2e-b9d1-af4bdacea3c4". Now even if the after repartitioning a prior partition, the fstab entry doesn't need to be changed.


All times are GMT -5. The time now is 12:37 PM.