You are not logged in.

#1 2011-08-06 18:13:46

HuckleSmothered
Member
Registered: 2010-03-25
Posts: 68

[SOLVED] mount command and fstab show different file systems

I recently setup my /etc/fstab to mount by LABEL.

  LABEL=ArchLinux        /    ext2    rw,noatime,errors=continue    0    0
  LABEL=Data30GB        /data    ext2    rw,noatime            0    0

When I reboot, these two drives work fine. But I run the "mount" command and it shows:

  /dev/disk/by-uuid/8fac6ab0-3d40-4676-bf30-b23c482b47b9 on / type ext2 (rw,noatime,errors=continue)
  /dev/sdb1 on /data type ext2 (rw,noatime)

I'm curious, why does mount not list things by how the fstab shows them? By the way, I have other drives labeled and mounted by label and it shows the device (i.e. /dev/sdd1) instead of the LABEL as fstab shows on those as well.

Anyone know why?

Last edited by HuckleSmothered (2011-08-06 19:38:35)

Offline

#2 2011-08-06 18:21:45

mrstegeman
Member
Registered: 2011-05-09
Posts: 21

Re: [SOLVED] mount command and fstab show different file systems

The root partition "/" is mounted according to your Grub config in /boot/grub/menu.lst, so I'm guessing your Grub config specifies your root partition by UUID.  Not sure about /data.

Offline

#3 2011-08-06 18:59:48

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] mount command and fstab show different file systems

It's the initramfs's job to mount your root. If you want it mounted by the block device name, mkinitcpio supports reading "root=LABEL=<labelname>" or "root=UUID=<uuid>" syntax from the bootloader. blkid will resolve this to a raw block device and mount it as /dev/sdxy instead of the udev symlink.

Last edited by falconindy (2011-08-06 19:00:13)

Offline

#4 2011-08-06 19:26:56

HuckleSmothered
Member
Registered: 2010-03-25
Posts: 68

Re: [SOLVED] mount command and fstab show different file systems

Thank you both!

Changing the /boot/grub/menu.lst kernel line for "root=" to /dev/disk/by-label/ArchLinux" mounted it as such.
Changing the /boot/grub/menu.lst kernel line for "root=" to /dev/sda1 mounted it that way as well.

Still curious about the other drives that get mounted, such as my /dev/sdb1. And how it is listed in the fstab by LABEL but in "mount" as /dev/sdb1. Any suggestions on this?

Offline

#5 2011-08-06 19:29:14

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] mount command and fstab show different file systems

LABEL= and UUID= aren't something the kernel understands -- they're tags interpreted by blkid that resolve to a device, e.g.:

$ blkid -lt LABEL=root -o device
/dev/sda2

This functionality is provided by util-linux's libblkid, which /bin/mount links against. In other words, that syntax in /etc/fstab is just a convenience feature.

Last edited by falconindy (2011-08-06 19:30:09)

Offline

#6 2011-08-06 19:30:50

mrstegeman
Member
Registered: 2011-05-09
Posts: 21

Re: [SOLVED] mount command and fstab show different file systems

Probably relates to what falconindy said above:

falconindy wrote:

blkid will resolve this to a raw block device and mount it as /dev/sdxy instead of the udev symlink.

If you want it to show the mount by label, maybe just do what you did with Grub and put the /dev/disk/by-label path.

Offline

#7 2011-08-06 19:38:12

HuckleSmothered
Member
Registered: 2010-03-25
Posts: 68

Re: [SOLVED] mount command and fstab show different file systems

Ahh! I think I understand now. Not sure I was fully comprehending the 1st falconindy post. I think I do now and it makes sense in my head. I'm content, thank you for the explanations, they've helped!

Offline

Board footer

Powered by FluxBB