LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unknown Device in fstab and mount Response (https://www.linuxquestions.org/questions/linux-newbie-8/unknown-device-in-fstab-and-mount-response-4175512768/)

rextca 07-30-2014 03:58 PM

Unknown Device in fstab and mount Response
 
I don't seem to have a problem, just a question that came up while trying to understand fstab.

I'm using SLES 11 SP3.

In the response to a
mount inquiry, I see:
/dev/disk/by-id/scsi-360024e806d150f001a7d2f5c1b07a0f1-part2 on / type ext3 (rw,acl,user_xattr)
Presumably this refers to /dev/sda2 since that's where my Linux installation is. To confirm that, I looked in the /dev/disk/by-id directory. There I found a lot of symbolic links in that or similar format, one of which did point to /dev/sda2. But this one was not there. I can't find any reference to it outside of the mount output, /etc/fstab file, and /etc/mtab.

My reading suggests that this space is supposed to be occupied by the name of a "special block device," so I guess that even though it looks like a file name, it isn't really.

How could I find out more about that object? Suppose I didn't actually know that it is /dev/sda2. How could I find out what it is?

Thanks!
Rex

smallpond 07-30-2014 04:38 PM

What do you get from doing:

Code:

/sbin/blkid /dev/sda2

rextca 07-30-2014 05:26 PM

/dev/sda2: UUID="c8852f0a-295a-4584-aa29-4dc9795d732d" TYPE="ext3"

Nice! I figured there was something like that command, but I was looking in all wrong places.

Thanks!
Rex

rextca 07-30-2014 06:26 PM

I'm slowly learning about this.
With the command
blkid /dev/sda2
I can find the UUID for /dev/sda2:
linux-support:~ # /sbin/blkid /dev/sda2
/dev/sda2: UUID="c8852f0a-295a-4584-aa29-4dc9795d732d" TYPE="ext3"


And with the UUID in hand I can go the other way:
linux-support:~ # blkid -U c8852f0a-295a-4584-aa29-4dc9795d732d
/dev/sda2


But what I don't see a way to do is identify this block device from the entry in /etc/fstab, /etc/mtab, and the mount command output ("/dev/disk/by-id/scsi-360024e806d150f001a7d2f5c1b07a0f1-part2").

I guess I'd better tell the whole story...
There was a problem with this system. It had been used with a different HDD for a while and when we put this one back in, the RAID controller failed to import the configuration for it. We rebuilt the RAID configuration and then hit a problem where the grub menu.lst file wasn't pointing to the disk. It had the above /dev/disk/by-id value in it for "root" and was apparently unable to find the disk with it. Well, there's no symlink at that location, so I guess that's not a big surprise. Anyhow, we updated the menu.lst file with the symlink that currently points to /dev/sda2 and now the system works.

But, it still shows this value as the "thing" mounted at /. I say "thing" because I don't know what it is. Apparently, it's something that allows /dev/sda2 to get mounted because I can access /. But it doesn't appear to be a symlink.

Rex

frankbell 07-30-2014 08:25 PM

What are the outputs of cat /etc/mtab and of fdisk -l.

rextca 07-30-2014 10:05 PM

linux-support:~ # cat /etc/mtab
/dev/disk/by-id/scsi-360024e806d150f001a7d2f5c1b07a0f1-part2 / ext3 rw,acl,user_xattr 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
debugfs /sys/kernel/debug debugfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,mode=1777 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
securityfs /sys/kernel/security securityfs rw 0 0
/dev/sr0 /media/SLES-11-SP3-DVD-x86_6407031 iso9660 ro,nosuid,nodev,uid=0 0 0

linux-support:~ # fdisk -l

Disk /dev/sdb: 146.2 GB, 146163105792 bytes
255 heads, 63 sectors/track, 17769 cylinders, total 285474816 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3f22f911

Device Boot Start End Blocks Id System
/dev/sdb1 * 2940928 285472767 141265920 83 Linux

Disk /dev/sda: 146.2 GB, 146163105792 bytes
255 heads, 63 sectors/track, 17769 cylinders, total 285474816 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000fbd0

Device Boot Start End Blocks Id System
/dev/sda1 2048 4208639 2103296 82 Linux swap / Solaris
/dev/sda2 * 4208640 285474815 140633088 83 Linux

Disk /dev/sdc: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xffc89865

Device Boot Start End Blocks Id System
/dev/sdc1 2048 41938943 20968448 83 Linux

Disk /dev/sdd: 70.8 GB, 70846513152 bytes
32 heads, 6 sectors/track, 720688 cylinders, total 138372096 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xebdf4694

Device Boot Start End Blocks Id System
/dev/sdd1 * 2048 138372095 69185024 83 Linux

Disk /dev/sde: 28.8 GB, 28752216064 bytes
255 heads, 63 sectors/track, 3495 cylinders, total 56156672 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe9d5ba13

Device Boot Start End Blocks Id System
/dev/sde1 2048 56154111 28076032 7 HPFS/NTFS/exFAT

linux-support:~ # cat /etc/fstab
/dev/disk/by-id/scsi-360024e806d150f001a7d2f5c1b07a0f1-part1 swap swap defaults 0 0
/dev/disk/by-id/scsi-360024e806d150f001a7d2f5c1b07a0f1-part2 / ext3 acl,user_xattr 1 1
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

linux-support:~ # ls -l /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 Jul 30 14:20 scsi-350060160902094335006016090209433 -> ../../sdf
lrwxrwxrwx 1 root root 9 Jul 30 14:20 scsi-360024e806d150f001b6ad5da1c3a1125 -> ../../sda
lrwxrwxrwx 1 root root 10 Jul 30 14:20 scsi-360024e806d150f001b6ad5da1c3a1125-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul 30 14:20 scsi-360024e806d150f001b6ad5da1c3a1125-part2 -> ../../sda2
lrwxrwxrwx 1 root root 9 Jul 30 14:20 scsi-360024e806d150f001b6ad5ef1d7504db -> ../../sdb
lrwxrwxrwx 1 root root 10 Jul 30 14:20 scsi-360024e806d150f001b6ad5ef1d7504db-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 9 Jul 30 14:20 scsi-360060160146510000fc2089308f1dd11 -> ../../sde
lrwxrwxrwx 1 root root 10 Jul 30 14:20 scsi-360060160146510000fc2089308f1dd11-part1 -> ../../sde1
lrwxrwxrwx 1 root root 9 Jul 30 14:20 scsi-360060160146510004d06bb6fbd57df11 -> ../../sdd
lrwxrwxrwx 1 root root 10 Jul 30 14:20 scsi-360060160146510004d06bb6fbd57df11-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 9 Jul 30 14:20 scsi-360060160146510004f06bb6fbd57df11 -> ../../sdc
lrwxrwxrwx 1 root root 10 Jul 30 14:20 scsi-360060160146510004f06bb6fbd57df11-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 9 Jul 30 14:20 wwn-0x5006016090209433 -> ../../sdf
lrwxrwxrwx 1 root root 9 Jul 30 14:20 wwn-0x60024e806d150f001b6ad5da1c3a1125 -> ../../sda
lrwxrwxrwx 1 root root 10 Jul 30 14:20 wwn-0x60024e806d150f001b6ad5da1c3a1125-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul 30 14:20 wwn-0x60024e806d150f001b6ad5da1c3a1125-part2 -> ../../sda2
lrwxrwxrwx 1 root root 9 Jul 30 14:20 wwn-0x60024e806d150f001b6ad5ef1d7504db -> ../../sdb
lrwxrwxrwx 1 root root 10 Jul 30 14:20 wwn-0x60024e806d150f001b6ad5ef1d7504db-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 9 Jul 30 14:20 wwn-0x60060160146510000fc2089308f1dd11 -> ../../sde
lrwxrwxrwx 1 root root 10 Jul 30 14:20 wwn-0x60060160146510000fc2089308f1dd11-part1 -> ../../sde1
lrwxrwxrwx 1 root root 9 Jul 30 14:20 wwn-0x60060160146510004d06bb6fbd57df11 -> ../../sdd
lrwxrwxrwx 1 root root 10 Jul 30 14:20 wwn-0x60060160146510004d06bb6fbd57df11-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 9 Jul 30 14:20 wwn-0x60060160146510004f06bb6fbd57df11 -> ../../sdc
lrwxrwxrwx 1 root root 10 Jul 30 14:20 wwn-0x60060160146510004f06bb6fbd57df11-part1 -> ../../sdc1

jpollard 07-31-2014 04:44 AM

It is usually easer to have fstab device identified by "UUID=xxxxxxx".

Even easier to use customized label names - though you do have to actually create and set the names yourself. ("LABEL=name").

See the manpage on fstab for details.

The issues with either UUID or dev/disk/by... is that they are set by udev, and recreating a filesystem will change the UUID, and you have to reset the number manually. You also have to do it for setting the label, but at least the label can be short, and relatively easy to remember.

rextca 07-31-2014 12:41 PM

It occurred to me that I don't know if those mounts that 'mount' reports and are in the mtab actually work. So I took them out of fstab and rebooted. The system came up fine without them, although swapon -s doesn't report any swap space. It turns out that even with those entries in fstab, swapon -n doesn't report any swap space, so I think the entries in fstab which used what look like non-existent symlinks had no effect except to fool mount and mtab into thinking they were mounted.

Now, with fstab specifying the mount for swap by UUID and not specifying anything mounted at /, the system seems fine. Neither the /etc/mtab file nor the /bin/mount output show the mounts at swap, but I guess I don't understand what they're good for.
linux-support:~ # cat /etc/fstab
UUID=6964fe9a-6481-4961-afe4-96a7029869ec swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

linux-support:~ # swapon -s
Filename Type Size Used Priority
/dev/sda1 partition 2103292 0 -1

linux-support:~ # mount
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,mode=1777)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sr0 on /media/SLES-11-SP3-DVD-x86_6407031 type iso9660 (ro,nosuid,nodev,uid=0)

linux-support:~ # cat /etc/mtab
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
debugfs /sys/kernel/debug debugfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,mode=1777 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
securityfs /sys/kernel/security securityfs rw 0 0
gvfs-fuse-daemon /root/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev 0 0
/dev/sr0 /media/SLES-11-SP3-DVD-x86_6407031 iso9660 ro,nosuid,nodev,uid=0 0 0

jpollard 07-31-2014 07:15 PM

Depends on the distribution. Fedora for instance, copies the fstab into the initrd. So even if you delete the fstab file, the same things still get mounted. And root (at a minimum) gets mounted by the initrd (based on the "root=...." parameter), and not the fstab.

catkin 08-01-2014 06:03 AM

IDK SLES but on Debian and Slackware you could find all the files under /dev that refer to the same partition by:
Code:

find -L /dev -samefile /dev/disk/by-id/scsi-360024e806d150f001a7d2f5c1b07a0f1-part2 2>/dev/null
For example:
Code:

root@CW8:~# find -L /dev/ -samefile /dev/mapper/CW8-d 2>/dev/null
/dev/CW8/d
/dev/dm-2
/dev/disk/by-uuid/33671fb3-2854-4784-ab58-17014964a298
/dev/disk/by-label/d
/dev/disk/by-id/dm-uuid-LVM-m9fWoLEqeRr2wnVHVNRyYuGmNmcveSMQTIIt4fdARfNwXni1VAFWlojkxaM03XvD
/dev/disk/by-id/dm-name-CW8-d
/dev/block/253:2
/dev/mapper/CW8-d

EDIT: discarding stderr is cosmetic to avoid trivial errors about transient files under /dev

rextca 08-01-2014 10:40 PM

Thanks folks! I appreciate your help.

Rex


All times are GMT -5. The time now is 04:25 AM.