[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question about hard disk partition strategy for debian



On 9 May 05 09:30:14 GMT, Lian Liming <lianliming@gmail.com> wrote:
> Hi all,
>     I have 35 GB hard disk space for installing debian/ustable.I am a
> common linux user and would like to do some web programming that means
> I need X winodows with KDE and LAMP(linux, apache, mysql, php). To
> limit damage upon system crash and better use the hard disk space, I
> want to know something for the partition strategy.
>    
>     Which directories should I separate from the "/", should I
> separate "/usr", "/var", "/tmp", "/home".... ? And then, how many GBs
> should i give to these partitions?
>
>    It is really welcome that someone can share their partition
> strategy with brief explanation why they did so.

I use LVM (Logical Volume Manager) to manage disk space and partitions.
This allows me to adjust my space allocations as circumstances change.
There's nothing worse than having to repartition and reinstall an
otherwise working system just because you miscalculated the amount of
space required for a partition. Resizing a partition is a matter of
minutes, in the worst case requiring you to reboot into single-user
mode.

The setup I use for new systems has two partitions: a standard (ext3 in
my case) partition for root, 250MB is plenty, and an LVM partition for
the rest of the disk. It is possible to install root on an LVM
partition but I choose to take a conservative approach. I install a
minimal system (base plus LVM plus rsync) on the root partition, create
the LVM pool then start carving partitions out of it. At a minimum I
create partitions for swap, /usr, /var and /tmp. For a desktop I add a
seperate /home. I don't have any firm suggestions for how large each
partition should be because the whole point of the exercise is to make
that unnecessary. If you underestimate, just make the partition bigger.
Starting with 1GB each for /home, /usr and /var is probably a good
idea. 125MB - 250MB for /tmp is usually ample. Moving data from the
root partition to an LVM partition is fairly easy with rsync.

LVM allows you to seamlessly increase the available storage by
installing a new disk and adding it to the pool. You can retire a disk
by removing it from the pool before physically removing it from the
machine. I've been through this process a few times now. I have a
server box and a desktop box. As I upgrade the desktop box I recycle
the old hardware into the server. Over the last few years it has had
2GB and 4GB disks replaced by a 20GB and a 40GB, all formerly used in
the desktop. The server filesystem has been migrated from disk to disk
without disruption other than a little downtime.

My server currently looks more-or-less like this:

root@thingy:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1             236M  124M  100M  56% /
/dev/mapper/vg0-home  3.0G  1.9G  1.2G  62% /home
/dev/mapper/vg0-usr  1008M  923M   86M  92% /usr
/dev/mapper/vg0-tmp   124M  4.1M  120M   4% /tmp
/dev/mapper/vg0-var   2.0G  1.2G  855M  57% /var
/dev/mapper/vg0-spool 5.9G  3.4G  2.6G  57% /var/spool
/dev/mapper/vg0-mirror
                      5.0G  1.7G  3.2G  35% /usr/local/mirror

Everything except /dev/hda1 is an LVM partition. There is still over
38GB of disk space waiting to be allocated.

-- 
Frank Copeland
Home Page: <URL:http://thingy.apana.org.au/~fjc/> 
Not the Scientology Home Page: <URL:http://xenu.apana.org.au/ntshp/>



Reply to: