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

Re: Format ext3 hard drives

>> On Tuesday 22 March 2011 02:42:36 pm Dan wrote:

D> I am using the netinst to install Debian. I have one hard drive of 160GB
D> and 2 hard drives of 2TB. Each hard drive has a ext3 partition for the
D> whole drive. I used ext3 instead of ext4, because that is the default
D> value in Squeeze.  The netinst is creating the ext3 partitions but it is
D> taking for ever.

>> On Tue, 22 Mar 2011 15:19:12 -0800, Greg Madden <gomadtroll@gci.net> said:

G> Not sure about the initial format but all subsequent fsck take lots of
G> time with ext3, esp 2 TB.

   If you're really set on ext3, specifying larger files and fewer inodes
   will definitely shorten the partition build and fsck times.  I have some
   Seagate 1.5Tb drives, and I decided on two ~700Gb partitions instead of
   a single giant one.  You might have to fool around with fdisk to get the
   sizes just the way you like.

   Details are below.

Karl Vogel                      I don't speak for the USAF or my company

Q: What's black and tan and looks good on a lawyer?
A: A Rottweiler.                                        --John J. Irvine

Disk use:

    me% df
    Filesystem   1M-blocks      Used Available    Use%   Mounted on
    /dev/sdb1          130         6       117      5%   /boot
    /dev/sdb2        19501       445     18080      3%   /root
    /dev/sdb5         7805       418      6997      6%   /var
    /dev/sdb6       699594    235065    450509     35%   /space1
    /dev/sdb7       699601    161094    524487     24%   /space2

    me% df -i
    Filesystem     Inodes      IUsed      IFree  IUse%   Mounted on
    /dev/sdb1       34136         11      34125     1%   /boot
    /dev/sdb2      313344         11     313333     1%   /root
    /dev/sdb5      126976         11     126965     1%   /var
    /dev/sdb6    11216896     169292   11047604     2%   /space1
    /dev/sdb7    11216896      64416   11152480     1%   /space2


    # partition table of /dev/sdb
    unit: sectors

    /dev/sdb1 : start=       63, size=   273042, Id=83, bootable
    /dev/sdb2 : start=   273105, size= 40017915, Id=83
    /dev/sdb3 : start= 40291020, size=  2008125, Id=82
    /dev/sdb4 : start= 42299145, size=2887362450, Id= 5
    /dev/sdb5 : start= 42299208, size= 16016742, Id=83
    /dev/sdb6 : start= 58316013, size=1435664727, Id=83
    /dev/sdb7 : start=1493980803, size=1435680792, Id=83

This script ran in about 25 minutes on a CentOS system:

    #!/bin/ksh -x
    # make filesystems with fewer inodes, larger files.

    export PATH=/sbin:/bin:/usr/bin

    date; mkfs.ext3                           /dev/sdb1
    date; mkfs.ext3 -J size=400 -i 65536      /dev/sdb2
    date; mkswap -L SWAP-sdb3                 /dev/sdb3
    date; mkfs.ext3 -J size=400 -i 65536      /dev/sdb5
    date; mkfs.ext3 -J size=400 -i 65536 -m 2 /dev/sdb6
    date; mkfs.ext3 -J size=400 -i 65536 -m 2 /dev/sdb7
    exit 0

Using fewer inodes added a total of nearly 80 Gb of available space on
/space1 and /space2, compared to one huge partition with default inode setup.

Reply to: