Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've a question: When I open /etc/fstab file, I see the following content:

proc            /proc           proc  nodev,noexec,nosuid 0       0
/dev/sdb1       /               ext4  errors=remount-ro   0       1   UUID=adf08252-b173-4679-a162-5786aa43eaf9
none            swap            sw                        0       0

Ok. If I understood well, these are mounted at the very start of the OS. However, when I got to /dev, I don't have any sdb1, but just sda, sda1, sda2 and sda5.

When I do sudo fdisk -l I find this:

Device Boot      Start         End  Blocks    Id  System
/dev/sda1   *    1           14212  114149376 83  Linux
/dev/sda2        14212       14594  3068929    5  Extended
/dev/sda5        14212       14594  3068928   82  Linux swap / Solaris

And if I run mount, I get this (and more stuff, but I believe this is what is important for this question):

/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)

So, my question is: How it's possible that in /etc/fstab I have sdb1, and this does not appear neither in mount and fdisk?

Thanks :)

PS: If there are recommended readings to understand all related to this, I would appreciate.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

/dev/sdb1 is being used for swapspace. Swap doesn't show up when you run 'mount'. This makes logical sense because it's just a raw space used by the kernel - there's no actual filesystem there for the OS to display to you.

You should see it listed if you cat /proc/swaps.

Your fdisk command doesn't show anything from sdb because by default it shows the devices listed in /proc/partitions. Run this to list the partitions on /dev/sdb:

sudo /sbin/fdisk -l /dev/sdb

Generally, examining /var/log/dmesg will give you a good idea of how disk devices are configured and initialized on your system.

share|improve this answer
    
Thanks. That gives me a better idea. Do you know any readings that could help me to understand this? –  Nobita Apr 3 '11 at 20:54

If I read you correctly, your root filesystem is listed as sdb1 in fstab, but in reality seems to be sda1? Your disks have probably swapped order at some point, or maybe there was a CD player during installation that you removed later?

Anyway, root device is typically not read from fstab. It is configured in your bootloader: see the /boot/grub/menu.lst file. Here root device is typically given like this: "root (hd0,0)". Disk 0 is simply the "first" disk by some measure. When the kernel starts, it has to read the startup stuff from somewhere: that is the root filesystem. Under normal circumstances, that filesystem is "adopted" by the starting system, so it will not be confused by naming issues.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.