[wplug] How to Partition a 120 GB Hard Drive

Michael Skowvron michaels at penguincentral.org
Tue May 3 12:49:47 EDT 2005


Poyner, Brandon wrote:

>My knee jerk reaction is to say that software mirroring (raid 1) doesn't
>have any performance gains,
>
RAID1 is slower on writes compared to a single drive because there is 
more work. Buffers must be copied and writes to each mirror must be 
issued and completed before the write() returns. Write performance will 
be limited to the speed of the slowest device.

On linux 2.6.8, read balancing is done based on last known head position 
of a device. Therefore, if there are two separate processes reading from 
a filesystem, there is a good chance that they will not interfere. One 
process' reads will be queued to one of the drives and the other 
process' reads to the other drive. The improved parallelism yields an 
overall gain in read throughput.

In this particular discussion, with respect to mirroring swap, there 
will be no performance gain. Swapping is handled by a single thread, so 
read performance (swap in) will only be as fast as one drive. Swapping 
out (write performance) will be worse because of the extra work to 
mirror the data.

Swapping performance may be improved by defining multiple raw swap 
partitions on different physical devices and assign the same priority to 
them. When under memory pressure, the kernel will round-robin allocate 
swap space from the available devices. The actual writing of the pages 
to the devices can take place in parallel.

Note that there won't be any performance gain if you are using IDE 
drives and they are on the same bus (master/slave). Only a single 
transaction can take place on an IDE bus, so if a read or write has been 
issued to one drive, nothing can be done with the second drive until the 
first transaction completes. If you are concerned about performance, 
never put more than a single drive (master) on an IDE bus.

If performance is of no concern, mirroring everything including swap may 
allow the machine to tolerate a drive failure without crashing.

> but that might be an outdated concept and I
>don't have the time right now to put it to test.  Do you have benchmarks
>that show better performance using software mirroring of swap across two
>disks is better than a single disk?  
>
>Brandon Poyner
>Network Engineer III
>CCAC - College Office
>412-237-3086
> 
>
>-----Original Message-----
>From: wplug-bounces+bpoyner=ccac.edu at wplug.org
>[mailto:wplug-bounces+bpoyner=ccac.edu at wplug.org] On Behalf Of
>Christopher DeMarco
>Sent: Tuesday, May 03, 2005 9:24 AM
>To: General user list
>Subject: Re: [wplug] How to Partition a 120 GB Hard Drive
>
>
>On Mon, 2 May 2005 21:49:23 -0400, "Kevin Squire"
>
>  
>
>>1) The current (5gb) drive will become /home
>>    
>>
>
>If you have other users on the box, they're going to fill up /home -
>they can't write anywhere else, presumably.  /home should be your
>biggest - or *potentially* biggest! - device.  Hold that thought...
>
>
>  
>
>>1) How much would you dedicate for / ? 
>>    
>>
>
>1GB, since you've got the space to burn.  If you've got everything else
>sliced up, you don't need more than ~400MB, but on a drive so huge it
>can't hurt.
>
>
>  
>
>>4) How would you break it up ?
>>    
>>
>
>Here's what I'd do: make two partitions, 1GB and 119GB.  Make the first
>one /.  Put the second in LVM
>(http://www.tldp.org/HOWTO/LVM-HOWTO/benefitsoflvmsmall.html) and carve
>it up as follows:
>
>/home: 10G
>/var: 5G
>/opt: 2G
>/usr: 10G
>/tmp: 2G
>/boot: 100M
><swap>: (RAM * 2)
>
>Run reiserfs on all of these filesystems.
>
>LVM2 (which you have if you've got a relatively recent Linux
>distribution) can GROW PARTITIONS ON THE FLY.  Reiserfs (ibid.) can,
>too.
>
>Now you've got ~90 GB sitting idle.  Whenever you find that you need
>extra space, just do
>
>"lvextend /dev/rootvg/home +10G; resize_reiserfs /dev/rootvg/home"
>(for example)
>
>Now your /home is 10 GB larger.  It takes about ten seconds to complete.
> Magic.
>
>What about that old 5G drive?  
>
>  - put <swap> on a RAID1 mirror across your two drives.  If you ever
>  have to swap (and most people do) you'll have much better performance.
>
>  - put it in the same volume group as the new drive, now you've got +5G
>  to allocate.  
>
>  - take backups of /etc, /boot and certain directories in /home
>
>  - dual-boot to other distros, *BSD, OpenSolaris, etc.
>
>  - just don't make it part of your filesystem (i.g. NOT /home)!  If you
>  run LVM+reiserfs you can shrink and grow on-demand; if you've got a
>  physical device in there you've got very few options when you
>  want/need to expand.
>
>
>Now, if you're doing all this, and you can afford to double your
>spending, buy a second, identical drive.  Modern RAID1 in the Linux
>kernel is very fast (benchmarked faster than hardware RAID controllers
>in some cases) and easy to set up.  A RAID1 mirror will give you a
>get-out-of-screwed-free card when (not "if") one of your hard drives
>dies.
>--
>Christopher DeMarco <cmd at alephant.net>     
>Alephant Systems     
>+1 412 708 9660 (cell)
>PGP public key at http://pgp.alephant.net
>
>_______________________________________________
>wplug mailing list
>wplug at wplug.org
>http://www.wplug.org/mailman/listinfo/wplug
>
>
>_______________________________________________
>wplug mailing list
>wplug at wplug.org
>http://www.wplug.org/mailman/listinfo/wplug
>  
>



More information about the wplug mailing list