Rebuild a Mirror to Increase Available inodes

Last night I had to rebuild the mirror on a web server to increase the available inodes as the default newfs set the level far too low. Here is the process I ended up using (total downtime ~1 minute).

# metadetach d9 d40
# metaclear d40
# newfs -i 8192 -f 4096 /dev/rdsk/c3t0d0s0
# metainit -f d42 1 1 c3t0d0s0
# metainit d40 -m d42
# mount /dev/md/dsk/d40 /mnt
# cd /mnt
# ufsdump of - /home | ufsrestore rf -
# umount -f /mnt
# /usr/local/apache2/bin/apachectl stop
# umount -f /home
# mount /dev/md/dsk/d40 /home
# /etc/init.d/apache start
# metadetach d9 d30
# metaclear d30
# metaclear d9
# metainit d41 1 1 c2t1d0s0
# metattach d40 d41

And here is the inode count before and after:

# df -F ufs -o i /dev/dsk/c3t0d0s0

Filesystem             iused   ifree  %iused  Mounted on
/dev/dsk/c3t0d0s0     283249     143   100%

# df -F ufs -o i /dev/dsk/c3t0d0s0

Filesystem             iused   ifree  %iused  Mounted on
/dev/dsk/c3t0d0s0     157397 34841515     0%

Leave a comment

Please be polite and on topic. Your e-mail will never be published.