Unix

HOME

MARVIN
ODIN
TERMINAL

lvm
ext3
tricks








Valid HTML 4.01!

xemacs powered

LVM

vgcreate -v pig /dev/hda3 /dev/hdc1 /dev/hdd1
lvcreate -L1T -npig pig
mkfs.ext3 /dev/pig/pig
tune2fs -c0 -i0 -r0 /dev/pig/pig

ext3

This is a quick list for creating an ext3 filesystem.
For barrier=1 a kernel 2.6.17 or newer is needed.
After the usual fdisk stuff we do this:
mkfs.ext2 -J /dev/hda1
tune2fs -c0 -i0 -O DIR_INDEX /dev/hda1

And this line is for our fstab:
/dev/hda1        /            ext3,ext2        defaults,barrier=1        1       1

If you have already an ext3 and want to add directory indexing
for more speed you have to do this:
tune2fs -o DIR_INDEX /dev/hda1
umount /dev/hda1 || mount -o remount,ro /dev/hda1
fsck -fD /dev/hda1


after mounting with barrier=1 check your logs.
If it doesn't work use hdparm to disable caching of your harddrive.

Tricks

backup a partition over network:
dd if=/dev/sda1 | gzip | ssh user@remote dd of=sda1_backup.gz
dd if=sda1_backup.gz | gzip -d | ssh user@remote dd of=/dev/sda1

replace blanks in filenames with _:
for i in *; do mv "${i}" `echo ${i} | sed 's/ /_/g'`; done

fineprint some textfiles as postscript:
a2ps -1RE -s2 testfile.pl testfile.txt

creating a slackware-package:
tar -xzf source.tar.gz
cd source
./configure
make
make install DESTDIR=/root/build
cd /root/build
makepkg source-1.5-i386-1.tgz
installpkg source-1.5-i386-1.tgz

useful bootoptions:
Linux single
Linux panic=60 4
Linux root=/dev/hdc3
Linux hda=3649,255,63 hdd=cdrom
hda 30gb LBA mode

man bootparam

recovering partition table:
gpart -b FILENAME -W /dev/hda /dev/hda

e2fsck /dev/hda1
e2fsck: Attemp to read block from filesystem resulted in short read
e2fsck -b 32768 /dev/hda1
alternate superblocks are stored typical in 8193, 16384, 32768

cloning a bad disk:
dd if=/dev/hda of=/dev/hdb conv=noerror,sync

gnu.orgs ddrescue:

ddrescue --max-retries=-1 /dev/hda /dev/hdb


Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de> - Last modified: Mon Oct 1 17:04:19 CEST 2007