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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Hi, I'm reading a text on linux partions and file systems, it says:
Some versions of the Linux boot loaders cannot access a kernel that is
outside the first 1024 cylinders on a disk. By putting the /boot partition at the
beginning of the drive you can be assured of not having a problem when accessing
the kernel at boot. This problem shows itself most often in cases of dual booting
Linux along with another operating system that is on the first partition.
My question is: why a linux distribution may have "no access to the kernel outside the first 1024 cylinders" on a disk?
Also, what does "putting the /boot partition at the beginning of the drive" mean?
PS. The text is extracted from "LPIC 1 Certification Bible"
This was a limitation of the BIOS and IDE drives years ago which is no longer a factor. Drives were divided into cylinders-heads-sectors which was used as an address to find data starting at zero. Cylinder 0 where the legacy MBR is located is the start of the drive. So creating a partition at the start of the drive is the beginning.
This limitation goes back to old disk controllers that didn't implement logical block addressing, and instead used cylinder, head, sector addressing.
The problem wasn't with Linux, which didn't have any issues...
The problem was with the old BIOS in that it only used 16 bit numbers for addressing, so getting the right address would overflow the 16 bit value. Even then, getting it right involved tricks - like knowing that if you specified 64 heads, that the truncation (disks normally never had more than 16, and usually only 8... or 4) would still get the right head number (since it was always zero for the first head, and zero for the first sector)... but reduce the size of necessary cylinder to something it could handle.
Once the boot block is loaded, it was the loader that actually did the work - unfortunately, it still had to use the BIOS for I/O, so it had to remain with the clumsy limitations built into the BIOS.
Thus, keeping the cylinder to something less than 1024 would always work.
Now "putting the /boot partition at the beginning of the drive" is to place the boot loader into something under cylinder 1024... It was the original reason to have a /boot as a filesystem anyway - the entire partition had to fit in the first 1024 cylinders - cylinder 0, head 0, sector 0, through cylinder 1024, head <whatever the max number was>, sector <whatever the max was, usually 32>.
The result was that the master boot record (the MBR) was at the beginning of the disk (making it always cylinder 0, head 0, sector 0), and anything the boot program read from that block would also be readable by the BIOS disk input functions - thus putting the kernel file into the boot partition would make it available to the boot loader.
yes, in LBA mode, each sector is assigned to a single unique number. But how can this unique number lead the firmware to read the correct head and cylinder?
Also, now that it is no longer the probem with BIOS and boot loader, what is the current role of /boot directory?
It now depends on the boot loader. The LILO loader read list of blocks to be loaded. Quite fast, but it depends on installing the boot loader each time you change the kernel. Grub knows about several filesystems. If you have grub you will see that the "stage 1.5" loader (grub legacy) has different filesystem support available. One of these is copied into the extended boot area of the boot disk. Grub2 does the same, though most of grub2 is now external to the /boot partition. This permits the boot loader to essentially, "mount" the filesystem and read from the disk according to the filesystem layout. This permits a more flexibility (at the cost of being a bit slower), and eliminates the need to reinstall the boot loader for each change. All that is needed is to put the kernel boot file in /boot, and adjust the grub configuration file. Since grub can follow the installed filesystem - it can read the necessary files.
Note, this still depends on the boot loader being able to read the filesystem that is used for /boot. It can't boot things it can't read - such as making /boot a ZFS filesystem (at least, not until a module has been written that would process it). It works fine for various ext filesystems, FAT, ... I understand it doesn't recognize btrfs yet).
One advantage to a separate /boot is that it becomes easy to make and restore backups.
One last thing - it isn't even necessary to have the /boot partition even mounted for the system to operate correctly. Once the kernel and initrd are loaded there isn't any need. Of course, if you are going to update the /boot files it will have to be mounted, but that is the only reason.
Last edited by jpollard; 12-29-2014 at 05:03 PM.
Reason: one last thing