LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Question About Partitions (https://www.linuxquestions.org/questions/linux-general-1/question-about-partitions-760417/)

linux4life88 10-07-2009 06:40 PM

Question About Partitions
 
I've used many different distributions (Ubuntu/Kubuntu, Mint, Sabayon and Zenwalk mostly) and have always had my partition scheme for the Linux part as:

Swap
/

But when looking at installing Arch Linux in the installation guide it lists you should have:

Boot Partition
Swap Partition
Root Partition
/home Partition

For one is the root and boot partitions really necessary? And secondly what is a root partition anyway? (Isn't the the partition of / I had above call the root partition. And wouldn't that also be where my home directory would be. So before I was basically putting the two together?) I know what the boot partition is but I've just never used one before.

camorri 10-07-2009 06:54 PM

Quote:

For one is the root and boot partitions really necessary?
This is not necessary, it is only a recommendation. I have to assume there are some maintenance benefits in separating / from /boot. I'm not sure what they are. I have always installed them on the same partition.

Quote:

what is a root partition anyway?
This is where the main system files go, not user files.

Quote:

And wouldn't that also be where my home directory would be.
/home should be on its own partition. In the event of a re-install, upgrade etc, if /home is on a separate partition from the / and /boot, then you can avoid reloading all your user data.

On a simple install, you can have / , /boot and /home all on the same partition. It will run.

Swap uses a different file system, and as far as I know has to be on a separate partition.

voyciz 10-08-2009 09:09 AM

This also allows you to specify different mount options in fstab. Such as ro for /boot and nodev,nosuid,noexec etc. for others. It is pretty convenient to be able to wipe out everything except for user files

lutusp 10-08-2009 03:42 PM

Quote:

Originally Posted by ubuntugeek194 (Post 3711601)
I've used many different distributions (Ubuntu/Kubuntu, Mint, Sabayon and Zenwalk mostly) and have always had my partition scheme for the Linux part as:

Swap
/

But when looking at installing Arch Linux in the installation guide it lists you should have:

Boot Partition
Swap Partition
Root Partition
/home Partition

For one is the root and boot partitions really necessary? And secondly what is a root partition anyway? (Isn't the the partition of / I had above call the root partition. And wouldn't that also be where my home directory would be. So before I was basically putting the two together?) I know what the boot partition is but I've just never used one before.

Don't create all these partitions. To put it very simply, a system with a lot of partitions will fail sooner than one with few partitions. The reason is that the probability of a partition-full failure varies directly with the number of partitions. It is not uncommon for a system like this to fail because one partition has filled up while there is plenty of space on other partitions.

Use this scheme:

1. System root (/): all system directories. About 20 GB at present.

2. Swap: twice the amount of system RAM.

3. A data partition that uses up all the rest of the drive space.

Very simple. An argument can be made for a /home partition, so you can reinstall Linux without having to back up and restore (although backing up is very wise). In such a plan, the third large partition could be labelled /home, and have extra directories under the /home directory for large data archives as well as the normal user directories.

voyciz 10-08-2009 07:01 PM

Quote:

Originally Posted by lutusp (Post 3712658)
Don't create all these partitions. To put it very simply, a system with a lot of partitions will fail sooner than one with few partitions. The reason is that the probability of a partition-full failure varies directly with the number of partitions. It is not uncommon for a system like this to fail because one partition has filled up while there is plenty of space on other partitions.

I've never heard of this...would you mind explaining further, please? And if it's only in cases where some partitions are filled to the brim while others have free space, then what if it was planned out so they don't get filled completely? None of my partitions are ever used above 70%

lutusp 10-08-2009 07:54 PM

Quote:

Originally Posted by voyciz (Post 3712818)
I've never heard of this...would you mind explaining further, please?

A hypothetical system with just one partition cannot fail due to excessive storage until the drive is completely full.

A hypothetical system with two partitions will fail if one of the partitions fills, regardless of how much space remains on the other partition.

It gets worse with more partitions -- the probability that one partition will fill before the others is very high and becomes higher as the number of partitions increases.

This is not rocket science. Imagine a special, self-defeating car with four fuel tanks -- if any of the four tanks empties before the others, the car suddenly stops on the freeway, regardless of how much fuel remains in the other tanks. That is what having multiple partitions does for system reliability. Partitions can be justified, but all such schemes should be weighed against their drawbacks.

Quote:

Originally Posted by voyciz (Post 3712818)
And if it's only in cases where some partitions are filled to the brim while others have free space, then what if it was planned out so they don't get filled completely?

Such planning is fraught with unforeseeable chance factors, and such planning is not necessary if the partitions are never created in the first place. Obviously we cannot predict which of several partitions will fill first, and it is equally obvious that we shouldn't have to make such a prediction.

Your argument seems to be that, if the drive isn't used to its full capacity, then there's no problem. Even that is a shaky premise, but it argues for something with no upside -- where is the advantage of splitting the drive up into isolated blocks of storage?

A system partition separate from a user partition makes sense -- you can install a new version of Linux without having to back up and restore. A swap partition makes sense. That's three ... after that, it stops making sense.

I think many people assume multiple partitions make sense, but without actually thinking through the implications and the risks.

Someone will surely argue that a multi-partition system is like a multi-engine airplane, but for this "airplane", it falls out of the sky as soon as any of its engines fails. This, by the way, is why Charles Lindbergh turned down a multi-engine plane to fly across the Atlantic in 1927 -- he discovered the plane couldn't stay airborne on one engine, so he realized one engine was actually safer (fewer things to go wrong). Incidentally, a team of flyers in a multi-engine plane disappeared without a trace at about the same time.

Pardon my digression. Again, it's not rocket science -- more partitions only decrease system reliability.

voyciz 10-09-2009 11:28 AM

Thank you, I see what you're saying. But is there no security gained by ro/nodev/nosuid mount options?

mudangel 10-09-2009 11:48 AM

Quote:

Originally Posted by voyciz (Post 3713619)
Thank you, I see what you're saying. But is there no security gained by ro/nodev/nosuid mount options?

Just curious, what do you gain by using those options? I mean, what are the benefits, and for what type of user?

lutusp 10-09-2009 02:48 PM

Quote:

Originally Posted by voyciz (Post 3713619)
Thank you, I see what you're saying. But is there no security gained by ro/nodev/nosuid mount options?

No, not if the partition can fill up. If the partition is mounted read-only to prevent anyone filling it up, it then represents a cure looking for a disease.

H_TeXMeX_H 10-09-2009 03:56 PM

In fact you can setup just one large partition and also have a swap file if you need it. This would not be a good idea if you plan on upgrading your system instead of complete wipe and reinstall. But, I'm just saying it's possible and it saves space, it's what I do. You don't even need swap usually, only if you edit large images or load large files into RAM that may slow the system to a crawl without swap space.

linux4life88 10-10-2009 03:16 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 3713910)
In fact you can setup just one large partition and also have a swap file if you need it. This would not be a good idea if you plan on upgrading your system instead of complete wipe and reinstall. But, I'm just saying it's possible and it saves space, it's what I do. You don't even need swap usually, only if you edit large images or load large files into RAM that may slow the system to a crawl without swap space.

This is what I've usually done in the past is have a swap and the rest in one big file. When I get around to installing Arch on my system instead of in a virtual machine I will follow the 4 partition setup just for change. Thanks everyone for the help.

salasi 10-11-2009 04:44 AM

Quote:

Originally Posted by camorri (Post 3711612)
Quote:

For one is the root and boot partitions really necessary?
This is not necessary, it is only a recommendation. I have to assume there are some maintenance benefits in separating / from /boot. I'm not sure what they are. I have always installed them on the same partition.

there have been benefits in doing this, depending on the filesystems in use. At one time (& I'm not exactly sure about the current situation) you could not boot with the kernel on some partition types such as ext3. The ext3 part of the problem may now be cured, but I am unsure of the situation with ext4, reiser4, xfs, jfs, btrfs, zfs, nilfs...

the simple work-around for this problem was to have a small ext2 partition for /boot, and that always seemed worthwhile to me in the case that you didn't know what distro and which fs type you were going to use next.

Quote:

Swap uses a different file system, and as far as I know has to be on a separate partition.
Not quite true; if there is a swap partition, it has to have its own filesystem, but a swap file is a viable alternative. At one time a swap file was considered to impose a performance penalty, but Andrew Morton has claimed that this is no longer the case. Can't say i've felt moved to try it, though.

Quote:

(Isn't the the partition of / I had above call the root partition. And wouldn't that also be where my home directory would be. So before I was basically putting the two together?)
your wording is somewhat unclear, so:
/ is the root of the filesystem. You will have one of these whatever you do. You may or may not have other things (such as /home) on this partition; if you have a separate /home partition, then /home will be on that separate /home partition, if you don't, it won't. You will always have /home, the only question is whether it is on its own partition or not.

For most purposes, it looks exactly the same, whether you have the home partition separate (eg, you can cd up and down the tree without ever noticing the difference) or not. With the separate home partition, you do have the concern whether the separate home partition is filling up, and so, as a minimum, you should watch out for that.

When you come to re-install or upgrade you distro version, however, having home separate does give the advantage that you can preserve this partition while clearing the others. This has the potential to be easier and save time, but does not obviate the requirement for a back-up, in case things go wrong.

Of course, you do not 'need' convenience, so it is not necessary to do this.

jmc1987 10-11-2009 06:33 AM

/
/home

these are the basic partitioning I use

And I do add a 2x ram swap as well even though I don't think I ever use it.

Deviathan 10-13-2009 11:32 AM

I agree with others here. /,/home, and swap should be all you need.

salasi 10-14-2009 04:20 PM

Sorry, you didn't state this explicitly, but everyone (& I include myself) seems to be giving you advice assuming that the question concerns a desktop system; if this is a server, then the advice would get a bit more involved.


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