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.
hi, i'm realatively new to linux... migrating from windows.
sorry if this a silly question, but why are their so many partitions in linux? in windows i always had 2 partitions: one for the OS and the other one for all my data... just in case the os dies on me.
in linux, it seems to make 3 partitions by default, which i can still understand: "swap" for virtual memory, "/home" for data and "/" for everything else. but if i do an expert install, it there are options for making partitions for "/var", "/root" and just about every other folder there is....
why break up the system to this extent? doesn't it have an impact on performance? how big should the partitions be? "/home" is part of "/", isn't it? so what effect does it have to have a partition "inside" another partition?
Well, you not really have to do all those partitions. It's always good to have /home if you are going to try other distros and want to save your configuration files though. The performance won't be reduced by doing that though. I use only two partitions actually, swap and /. If you've got a good amount of RAM and you are not running servers and such, you could even skip swap.
Just do the other partitions (/src, /usr, whatever) if you sometime need to install another distro or get yourself into trouble and don't want to lose everything... It's more a matter of taste and organization then a real case when going down to partitions...
For linux, you need only two partitions - root (/) and swap. The root one is where all your files will be stores, and the swap is used as virtual memory. If you want to have windows installed on the same computer, you will also need a windows partition.
Well, actually linux filesystems aren't that confusing nor convoluted. Mainly there are two partitions for linux install--the swap and the root partition. Swap is used for programs that are bigger than main memory, so the sytem "swaps pages from ram" to the harddisk. Then you have the main filesystem tree with the root ( / ). Various devices like your cdrom and floppy, which have different filesytems then either windows or linux, can have their filesystem tree "mounted" on parts of the linux tree. Example-- "/dev/cdrom" filesystem is mounted on "/mnt/cdrom". There shouldn't be a separate partition for /home though.
You don't need to make extra partitions - generally in Linux you only need to set up a relatively small swap (256Mg or 512Mg max) and leave the rest to the root (/) parition. All other directories (/home, /var, /usr, etc) will be created under /
That being said though, it's an excellent idea to set up your /home directory on its own partition. Should you want/need to reinstall your OS, you do not need to worry about killing all your own personal data.
Partitioning is an extremely subjective topic - you may want to use the Search function here at LQ to find similar threads. -- J.W.
hi, i'm realatively new to linux... migrating from windows.
Be welcome!
sorry if this a silly question, but why are their so many partitions in linux?
Because this prevents a lot of problems. Most usual, prevents data lost and corruption.
in windows i always had 2 partitions: one for the OS and the other one for all my data... just in case the os dies on me.
Well, this is already a bit of hacking win. To my knowledge, a default win install uses 1 partition, both for OS and data.
in linux, it seems to make 3 partitions by default, which i can still understand: "swap" for virtual memory, "/home" for data and "/" for everything else. but if i do an expert install, it there are options for making partitions for "/var", "/root" and just about every other folder there is....
But if you choose expert, the system will give you tools for partitioning for a specific purpose, or for a large system, or something different. Its pointless to use expert partitioning if you do not plan to do anything different than the default partitioning.
Also, you might want to allocate certain areas of your disk to certain partitions, to improve performance.
why break up the system to this extent? doesn't it have an impact on performance?
A partition doesn't "break" a system. Partitions are tools designed to let you allocate disk space efficiently. I know win doesn't use partitions very much, but Lin does.
how big should the partitions be?
That depends heavily on the use of the system.
"/home" is part of "/", isn't it?
No, they are different partitions. But you see them that way.
so what effect does it have to have a partition "inside" another partition?
The only case where you have partitions inside partitions are extended partitons who host logical partitions. Is this what you're talking about?
Hey, by doing a /, swap and a /home partitioning scheme, you are doing fine. If you plan to do something different than that, look for specific documentation to accomplish specific setups.
Hope it helps!
Unless you specifically allocate a separate partition for /home, it will be under /
By default it is not a separate partition. As indicated before however, there are benefits to setting up /home as an independent partition -- J.W.
What we, the average desktop user, should do is, at most is /, swap, and /home. Any more can be a means to waste disk space. We install and delete a lot of stuff, so we can't really plan our disk space.
These divisions actually have purpose. Disk performance can be improved by slicing it up. Each partition can have its own filesystem, depending on the files its intended to contain. Dividing the structure up can help in recovery of important data in the case of disk failure. Don't worry about it. For the average user we have cd burners to back up our files and the install disks to get our OS back if that happens.
I like to play with distros and OSs, so I go for /,swap,/home for my working distro and I share the swap between them all, and go with / for the extra toy distros.
thanks for the explanations! only one more thing that i don't quite get:
if i make a "/" partition and a "/home" partition, what happens if the "/home" partition fills up? will it be able to store more data on the "/" partition? how about vice versa?
If the /home partition fills up, that's it, no one will be able to write files to it until somebody frees up some space. In face, this is one reason why servers have multiple partitions. For instance if a process goes out of control and fills up /var with log files, it won't affect any other partitions. Filling the / filesystem totally full can often have unpleasant consequences (although perhaps modern Linuxes handle it better -- the last system I saw that running on wad Red Hat 5.2).
Originally posted by btmiller If the /home partition fills up, that's it, no one will be able to write files to it until somebody frees up some space. In face, this is one reason why servers have multiple partitions. For instance if a process goes out of control and fills up /var with log files, it won't affect any other partitions. Filling the / filesystem totally full can often have unpleasant consequences (although perhaps modern Linuxes handle it better -- the last system I saw that running on wad Red Hat 5.2).
I was reading about that problem (in the FAQs for OpenBSD) shortly after I had posted. Thanks for bringing it up. That is one style of DDoS attack - fill the log file until; it fills the partition - which is why someone with a webserver might seperate /var
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.