LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   new fstab mount option guide for fixed drives - suggestions/mistakes? (https://www.linuxquestions.org/questions/linux-general-1/new-fstab-mount-option-guide-for-fixed-drives-suggestions-mistakes-547302/)

gregconquest 04-19-2007 07:37 AM

new fstab mount option guide for fixed drives - suggestions/mistakes?
 
(note: I started this thread at http://ubuntuforums.org/showthread.php?t=412717), but it hasn't been getting much response there. I'm hoping it will fit in better here. http://www.suseforums.net/index.php?showtopic=34332 is also a related post in the SUSE forums.)

I've been reading various tutorials on fstab and mounting, but I still don't really understand. There are varying ways to achieve the same end results -- and nowhere among the most popular general fstab guides/tutorials are there many examples of typical partition types and their common mount strategies.

So, what I would like to do is to make a different kind of guide. I'd like to compile a list of typical partition types and common fstab entries for them and give concise explanations for why each element is chosen. I will edit this as feedback comes in and it will essentially publish itself here.

If this kind of guide already exists, it is well hidden. So, please, help me form this into something useful :p If this ever gets done -- done well, please feel free to post this somewhere else or to translate the commentary. Please do link back to this as the source and help me keep this thread updated. Email me (conquest [at] spamcop [dot] net) if the thread gets old and you'd like to see an alteration of the top post. Maybe making a wiki would be good for this too. I'll do that if it seems appropriate.

Situation 1: Windows partitions (NT, 2000, XP, 2003, Vista)
1A
Code:

/dev/xxxx  /media/mountpoint  ntfs  user,ro,auto  0  0
(user allows anyone to mount, ro makes it read-only since ntfs is a MS-protected format, auto mounts it at boot automatically)
or
1B
Code:

/dev/xxxx  /media/mountpoint  ntfs  nls=utf8,umask=0222  0  0
(nls=utf8 includes unicode for non-English users, umask=0222 (-r-xr-xr-x) does what?)
or
1C
Code:

/dev/xxxx  /media/mountpoint  ntfs  defaults,nls=utf8,umask=007,gid=46  0  1
(nls=utf8 includes unicode for non-English users, umask=007 ??? Makes for 659 permissions?, gid=46 ??? )

Situation 2: ntfs data partitions (generally from Windows):
Code:

(same as above???)
Situation 3: fat-32 data partitions (ideal shared partition between linux, windows, and apple's mac os):
Code:

/dev/xxxx  /media/mountpoint  vfat  iocharset=utf8,umask=000  0  0
(iocharset=utf8 includes unicode for non-English users, umask=000 allows most liberal file permissions)

Situation 4: ext3 data partitions (partitions shared between different linuxes, mac osx, and even Windows (using "Ext2 Installable File System for Windows", for example)):
Code:

I don't know. I can find no examples of this on the fstab tutorials.
Maybe
/dev/xxxx  /media/mountpoint  ext3  defaults  0  2

Situation 5: other linuxes themselves, their root partition:
Code:

???
again, maybe
/dev/xxxx  /media/mountpoint  ext3  defaults  0  2

The format of fstab is also changing, from something like this:
Code:

/dev/sda2  /media/sda2  ntfs  defaults,nls=utf8,umask=007,gid=46  0  1
to something like this:
Code:

# /dev/sda2
UUID=9068AF8E68AF7220  /media/sda2  ntfs  defaults,nls=utf8,umask=007,gid=46  0  1

However, I cannot find any authoritative links on this:
http://ubuntuforums.org/showthread.php?t=405630 (My device are now "sda" than "hda")
http://www.linuxquestions.org/questi...d.php?t=544734 (ide drives show up as special device)
Can anyone point out where this transition is explained, please? An announcement somewhere?

Thank you,
Greg Conquest

key phrases: typical mount options, example fstab's, example fstab,

references:
umask
http://www.zzee.com/solutions/linux-permissions.shtml (linux permissions)
http://www.tech-faq.com/umask.shtml
gid
http://linux.about.com/cs/linux101/g/gid.htm (About.com's short note on GID)
uuid
http://www.die.net/doc/linux/man/man1/uuid.1.html (man page for uuid)
mount
http://www.die.net/doc/linux/man/man8/mount.8.html (man page for mount)


more links:
http://www.tuxfiles.org/linuxhelp/fstab.html (top guide according to google -- no fixed-drive examples are given, though)
http://www.psychocats.net/ubuntu/mountwindows has several example fstab entries, but it has little to no explanation of those mount options.
http://www.linuxquestions.org/linux/..._and_explained (another fstab tutorial)
http://wiki.archlinux.org/index.php/Fstab

Nishtya 04-20-2007 03:43 PM

you forgot http://wiki.linuxquestions.org/wiki/Fstab
:cry:

gregconquest 04-20-2007 08:30 PM

I have found the source of one of my fstab problems. Two different partitions on my system, sdc2 and sda2, have the same UUID! I tried sdc1 and sda1 just to compare two other partitions on the same drives. Their UUID's are fine.

Code:

$ sudo vol_id -u /dev/sdc2
183edeb8-2557-4475-99fd-b4e71c22391b
$ sudo vol_id -u /dev/sda2
183edeb8-2557-4475-99fd-b4e71c22391b
$ sudo vol_id -u /dev/sdc1
4804A2DE04A2CDEE
$ sudo vol_id -u /dev/sda1
0EA01647A01635A5

What is wrong? I didn't set the UUID's.

Below I manged to change the LABEL of one the partitions, so they do have different labels and /dev/sdxx ID's, but the UUID remains non-unique.
Code:

$ sudo e2label /dev/sdc2              <-- checking label
ubuntu                                <-- results
$ sudo e2label /dev/sda2              <-- checking label
ubuntu                                <-- results, same label
$ sudo e2label /dev/sda2 OStest3      <-- changing label
$ sudo e2label /dev/sda2              <-- checking label
OStest3                              <-- results, label successfully changed
$ sudo e2label /dev/sdc2              <-- checking label
ubuntu                                <-- results, still OK
$ sudo vol_id -u /dev/sda2            <-- checking UUID
183edeb8-2557-4475-99fd-b4e71c22391b  <-- results
$ sudo vol_id -u /dev/sdc2            <-- checking UUID
183edeb8-2557-4475-99fd-b4e71c22391b  <-- results, two partitions, two labels, one UUID

Now I'm really confused. Even though I set these partitions label according to the above, when they are mounted under kubuntu, they are reversed (ignore the sdd2 and sdb2 here. They seem to change per install, application reading them, boot, . . .):
Code:

# kubuntu's fstab (section)
# /dev/sdb2    UUID=183edeb8-2557-4475-99fd-b4e71c22391b    (another linux installation)
LABEL=ubuntu    /media/ubuntu ext3    defaults        0      2
#
# /dev/sdd2  WRONG UUID  UUID=183edeb8-2557-4475-99fd-b4e71c22391b    (for testing installs)
LABEL=OStest3      /media/OStest3 ext3    defaults        0      2

In Konqueror, though, the drives are reversed. I booted into ubuntu and put a folder in root called, 0_ubuntu_desu. From within kubuntu, however, this folder shows up in the root of OStest3.

I am confused. Using UUID should free me from these changing IDE/SATA designations.

At a loss :(
Greg

PS Nishtya, I'm trying to work this out at http://ubuntuforums.org/showthread.php?t=412717 and then posting the results here. http://wiki.linuxquestions.org/wiki/Fstab has been on the other post, but thanks for the pointer.

gregconquest 04-21-2007 08:55 PM

UUID issue resolved
 
I found out what had caused the duplicate UUID. I had used BootIt NG to essentially clone a partition (image and paste in BootIt terms). I cloned ubuntu as OStest3. Thus, both had the same UUID. I reformatted OStest3 and it now has its own UUID.

I also noticed in all this that since I didn't alter root's entry in fstab, that I was actually using BootIt to boot into one partition, and then having another actually running! OStest3 was going to ubuntu or vice versa.

I need to figure out the limitations and dangers on cloning partitions with BootIt, but the damage here has apparently all been undone :)

Now I can get back to creating my optimal, annotated fstab along with example mountings -- and a few suggestions on using UUID vs. LABEL vs. /dev/sdxx.

Thanks for the help,
Greg


All times are GMT -5. The time now is 09:57 PM.