Skip to main content

Why make /boot on its own partition?

More
19 years 9 months ago #7016 by jacko0
I wondered why Linux likes to put /boot on its own Partition.
Can't I just have all file systems in one partition?

I mean I don't put my "Windows" directory on a different partition to all my other stuff.

Thanks


Jacko
More
19 years 9 months ago #7017 by cybersorcerer
First off, we are going to need a little more info. Such as, what distro are you running and what version of that distro. Secondly, are you sure it's on its own partition. For example, your /(root dir) is mapped to hda1(partition) and your /boot is mapped to hda2, which to me, sounds a bit odd. Double check everything and let us know as to the structure of your file system

"He who breaks something to find out what it is, has left the path of wisdom."

Gandalf the Grey
More
19 years 9 months ago #7018 by MezzUp
Yeah, I've seen some distros like to put /boot on a separate partition(often hdx1). I think it's because if you don't unmount your / properly and/or the / partition is un-clean you have to be able to boot to „scandisk“ the pariton.

If /boot is a folder on the root(/) partion, you are unable to do anything if that partition gets corrupted. However, if /boot is on a separate partition(and never mounted unless access is needed) it's less likely to get corrupted and therefore you should be able to boot you distro and fix the / partition.

And I think it's also used to add a little security so you don't accedentally delete your kernel(which should be a problem unless your using your root account for everything :twisted:)


ps. this is only based on my little Linux knowledge, so feel free to flame :)
More
19 years 9 months ago #7019 by ReX
Partitioning for Linux seems to be a little confusing at times, every one seems to have their own way of doing it and their own reasons. The basic idea for having multiple partitions is for security, stability, and easy of recovery. Like MezzUp said it would be alot easier to recover your system if /boot has it's own partition, also it can be mounted as read only so no one can write to it. If you put your system files on the same partition it could also be possible to fill that partition untill you system has troubles. But if you seperate them you won't have as many problems.

Hope that helps some.
More
19 years 9 months ago #7022 by MezzUp
Yeah, there are alot of ways to partition Linux. The basic setup is root+swap*, but I've seen alot of setups:

The number of partitions is highly dependent on your environment. For instance, if you have lots of users, you will most likely want to have your /home separate as it increases security and makes backups easier. If you are installing Gentoo to perform as a mailserver, your /var should be separate as all mails are stored inside /var. A good choice of filesystem will then maximise your performance. Gameservers will have a separate /opt as most gaming servers are installed there. The reason is similar for /home: security and backups.

As you can see, it very much depends on what you want to achieve. Separate partitions or volumes have the following advantages:

* You can choose the best performing filesystem for each partition or volume
* Your entire system cannot run out of free space if one defunct tool is continuously writing files to a partition or volume
* If necessary, file system checks are reduced in time, as multiple checks can be done in parallel (although this advantage is more with multiple disks than it is with multiple partitions)
* Security can be enhanced by mounting some partitions or volumes read-only, nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.

However, multiple partitions have one big disadvantage: if not configured properly, you might result in having a system with lots of free space on one partition and none on another.

I've also read about having /var on a seperate partition so logs don't fill up the system.

And just FYI, "Ext2fs reserves some blocks for the super user (root). Normally, 5% of the blocks are reserved. This allows the administrator to recover easily from situations where user processes fill up filesystems."

* It is possible to use a swap file (nt. pagefile) in Linux, but not recommended
More
19 years 9 months ago #7023 by cybersorcerer
Well, I always store backups of my data for linux, so getting a corrupted / has never worried me all that much, minus the time spent to get it back up(which gives me something to do ;-) And the fact that I set read only permissions to /boot during the hardening phase and just chmod it to give me write privs when I need them(moving and renaming bzImages and whatnot). As for coming across that before, I never have and I have used a LOT of different distro's.. but then again Im not an expert so perhaps someone who is could give more of an insight then the former posts

"He who breaks something to find out what it is, has left the path of wisdom."

Gandalf the Grey
Time to create page: 0.137 seconds