Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello All,
I have a question on how the kernel knows the root directory. For example, in grub menu.lst file we specify root=/dev/hda1. This tells the kernel to find mount the root directory from /dev/hda1. But to read /dev/had1 it should first know where is '/' . I couldn't understand how this is being done. Could anybody please explain me?? Thank you....
My understanding, which could be wrong, is that when you install grub, it puts a hard link into the MBR (Master Boot Record) to the /boot directory that grub will use. During boot, it queries the menu.lst file, as well as the device.map file, and from them decides where "/" is. Alternatively, if you use disk labeling, then it will search for the disk with the label specified in menu.lst and that will be "/".
My thinking would be that by "mounting as root" a partition, no matter where you have the partition, would be root. So that any partition could be mounted as /root
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
isn't it defined by fstab, which is created on install?
eg:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda2 during installation
UUID=44169a1f-a1aa-476a-9837-48ccb9853381 / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=d43e0044-5a1d-4f17-abc3-c6fd77b20dd7 /boot ext4 defaults 0 2
# /media/music was on /dev/sdc1 during installation
UUID=11aed5b6-5aa7-4f51-85a6-99017cb89c09 /media/music ext3 defaults 0 2
# /media/stuff was on /dev/sdb2 during installation
UUID=bbe33dc3-0a1d-43cb-8874-c907b4954129 /media/stuff ext3 defaults 0 2
# /media/videos was on /dev/sdd1 during installation
UUID=8f115647-e644-4bb4-a250-8cc42fbbe186 /media/videos ext3 defaults 0 2
# swap was on /dev/sdb1 during installation
UUID=8f14d31e-7c39-40ef-ba63-76ef5ad0426f none swap sw 0 0
/dev/scd1 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
sshfs#user259713@172.16.0.21:/home/user259713/backend /mnt/modules fuse user,noauto 0 0
sshfs#user874-3985@172.16.0.22:/home/user874-3985/www /mnt/website fuse user,noauto 0 0
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.