LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How big partitions should I create? (http://www.linuxquestions.org/questions/linux-newbie-8/how-big-partitions-should-i-create-739518/)

Grife 07-12-2009 04:47 AM

How big partitions should I create?
 
I'm going to start using Linux as my only operating system for indefinite time now and going to do my transfer from virtual machine to bare hardware today, using openSUSE 11.1 AMD64 as it's finally capable of being upgraded without burning a new DVD every single time.

Question itself
Now users who have been running same installation of Linux for a long time, how big partitions would you recommend for the following?
/boot = considering 200 MB, enough?
/ = considering 50 GB, overkill or too little (remember, I'll be running this installation for a long time)?
swap = 2Gb (just for hibernation so should be enough as I have 4Gb RAM)
/home = the rest

Also, what long-term advantage would I gain if I'd make the system run as LVM-partitioned system instead of traditional partitioning?

catkin 07-12-2009 05:28 AM

Hello Grife :)

200 MB plenty for /boot unless you plan on experimenting with different kernels. The system I'm on is using ~85 MB for 4 kernels -- one current and three old ones for "backup".

Your question about / is unanswerable if it is for "everything" because only you know about your own data requirements including possible server roles. If you're running your local electricity utility's billing system then you'll need a tad more than 50 GB! :)

Here's a sample workstation (called CW8) disk layout using LVM, perhaps typical, but very few videos kept online
Code:

df --human-readable
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/CW8-root  6.0G  2.6G  3.4G  43% /
/dev/mapper/CW8-home  50G  26G  22G  55% /home
/dev/mapper/CW8-opt  1016M  596M  390M  61% /opt
/dev/mapper/CW8-usr  8.0G  2.4G  5.2G  32% /usr
/dev/mapper/CW8-var    50G  32G  16G  67% /var
/dev/sda2            236M  81M  143M  37% /boot

Big advantage of a separate /home is being able to clean install the system and not have to re-load personal data and configurations.

An advantage of smaller file systems is it doesn't take so long to fsck one at boot time when it has been mounted too many times without checking.

The following remarks about LVM are for ext3 file systems (because I don't know about other's perhaps more dynamic capabilities) and when 24x7x365 is not a consideration.

The really big advantage of LVM is being able to snapshot a file system for backup and so avoid both files changing during backup and data-skew amongst coherent sets of files.

I cannot see any advantage of having swap under LVM (but am open to contrary arguments).

If / does not include dynamic files and is relatively small (that is /var and /home are on separate file systems) there is little advantage in having it on an LVM volume. You have to boot off something other than / if you want to re-size it anyway.

One difficulty of LVM is that you cannot (yet?) resize an HDD (or HDD array) partition holding LVM data. Bad news if it's taking up most of your only HDD and you unexpectedly need to find space for another partition. Workaround by fitting a temporary HDD and moving the LVM data to that and back again, resized.

Sorry -- I don't know about swap and hibernate.

Best

Charles

karamarisan 07-12-2009 05:29 AM

What I'd recommend for you:

/boot = 200MB is fine. I've never seen a /boot partition that needed more.
/ = if you're really that cramped, I'd say 20 GB should be more than fine. The machine I'm typing this from is a Fedora install that's around a year and a half old (based on: I think it was originally Fedora 8), and with no special maintenance / is only 15 GB right now. It will start much smaller and maintenance will keep it that way if you ever come anywhere near that limit.
/home (or /home/you) = all remaining available space. I highly recommend keeping your homedir on a separate partition. In the event that you want to do a reinstall - say, if you decide you like another distro more than openSUSE - your life will be MUCH easier if preserving your personal data is as simple as just mounting that partition as /home (or /home/you).
swap = If you've got 4 GB RAM, I feel like you're risking something if you don't have at least that much swap and you plan to hibernate. 2 GB more isn't really that much, so I'd err on the side of caution and go 4 GB swap if I were you.

As for LVM, I'd say skip it. Functionally, the main promise of LVM, as I understand it, is that you can add space to logical partitions very, very easily (new disks can literally just be added to your volumes), with the drawback that it adds a good deal of complexity over simple primary/extended partitions and that the live environments you will use to recover your system if it gets screwed up may not support it quite so well. If you're doing custom partitioning anyway and don't have a particular reason you want to use LVM, I suggest you don't.


Edit: Did not know LVM could do that. Guess I need to read up. : )

Grife 07-12-2009 05:49 AM

This is what I've been thinking now:
/ = 40GB
/boot = 200MB
swap = 8GB (I see myself doubling RAM sooner or later)
/home = the rest

Now one huge problem arises if I don't use LVM: That is, if I add another HDD and want to expand my /home on it, it's impossible without LVM. Right?

catkin 07-12-2009 06:29 AM

Hello Grife :)
Quote:

Originally Posted by Grife (Post 3604956)
Now one huge problem arises if I don't use LVM: That is, if I add another HDD and want to expand my /home on it, it's impossible without LVM. Right?

AFAIK (forgetting arrays) there's no way without LVM for a file system to be on two HDDs but is that an issue? By the time you get there, you'll probably find most of your data is in one directory under /home -- perhaps for one user or, if you have only one user, one particular directory.

Let's say your running out of space in /home/ and /home/grife/videos/ is taking most of the space. So you get another HDD, create a file system on it, move all the /home/grife/videos/ files to it and have it mounted at boot on /home/grife/videos/

Alternatively you could switch to LVM at that time. So you get another HDD, create a partition for LVM data on it, create volume group, volume, file system and move all the /home/ files to the new file system which you then have mounted at boot on /home/. Then you could delete the old partition that had the /home/ file system in it and re-use it for LVM data.

Best

Charles

Grife 07-12-2009 06:35 AM

Quote:

Originally Posted by catkin (Post 3604977)
Alternatively you could switch to LVM at that time. So you get another HDD, create a partition for LVM data on it, create volume group, volume, file system and move all the /home/ files to the new file system which you then have mounted at boot on /home/. Then you could delete the old partition that had the /home/ file system in it and re-use it for LVM data.

What about doing the following: upon creation of filesystem I make / and /boot as regular partitions but make /home as logical volume so it could be expanded easily? That way I'd eliminate hassle and dangers of LVM I've read about on system critical partitions but enable easy extension of most space-demanding partition. Possible?

EDIT: yes it is and I'm taking that approach for the most careful balance between robustness, expandability and future-proofing. Thank you all for your input! :)

catkin 07-12-2009 07:02 AM

Hello Grife :)

Sounds like a good plan! Must be because that's pretty much what I'd do if I was starting over with the exception that I'd put /var (and maybe /usr) in separate LVM-based file systems for the benefits of snapshotting prior to backing up. Hey, Microsoft thought it was worth using Veritas' expertise to add snapshotting to Windows when they created XP!

You probably want swap on a regular partition too (you knew that already).

For maximum flexibility (in case you want to install something like Windows which needs a primary within the first 4 GB of the disk -- and depending on how big your HDD is) you could put /boot as the first primary, leave space for another primary or two and then use logical partitions for all the rest.

Best

Charles

karamarisan 07-12-2009 09:44 AM

Quote:

Originally Posted by Grife (Post 3604982)
What about doing the following: upon creation of filesystem I make / and /boot as regular partitions but make /home as logical volume so it could be expanded easily? That way I'd eliminate hassle and dangers of LVM I've read about on system critical partitions but enable easy extension of most space-demanding partition. Possible?

It's probably better to just make it a normal partition and, if you buy a new drive, just transfer everything and then switch the entry in fstab. The way I'm seeing it, spreading your data among drives with LVM provides all the increased risk of any drive failure that comes with RAID (i.e., two disks are more likely to have a failure than one), without the redundancy benefit to make up for it. Up to you if that's a risk worth taking, though.

catkin 07-12-2009 09:59 AM

Quote:

Originally Posted by karamarisan (Post 3605137)
LVM provides all the increased risk of any drive failure that comes with RAID (i.e., two disks are more likely to have a failure than one), without the redundancy benefit to make up for it. Up to you if that's a risk worth taking, though.

Good point and a disadvantage of LVM I hadn't thought of, probably because I rely on backups rather than HDDs to protect the data. Even so, re-configuring LVM does create extra work when recovering from a failed HDD.

karamarisan 07-12-2009 10:04 AM

Oh, absolutely - he who claims RAID as his backup solution has a fool for a sysadmin. I suppose if you have good disk backups, the increased failure risk isn't a big deal, but you don't get the speed benefits, either. LVM just isn't that exciting, though I still haven't looked into that snapshotting thing.


All times are GMT -5. The time now is 05:51 AM.