a few tape commands

backup and filesystems No Comments »

Show status of tape drive
mt -f /dev/st0 status

Backup directory (+sub directories) to tape
tar cfz /dev/st0 /var/data/OUTLOOK

List contents of tape
tar tvf /dev/st0

More information can be found at:
http://nic.phys.ethz.ch/readme/80

DRBD cutover instructions

backup and filesystems No Comments »

DRBD cutover procedure:
------------------------------

.) on primary node:
# umount /mnt/ha (or wherever /dev/drbd0 is mounted to)
# drbdadm secondary all

.) on secondary node:
# drbdadm primary all

dmesg now should show the following line:
"drbd0: Secondary/Secondary --> Primary/Secondary"
This means that the secondary node is now master

# mount /dev/drbd0 /mnt/ha

Resize EXT3 partition

backup and filesystems No Comments »

First, check for block size of partition:
dumpe2fs /dev/hda1|grep 'Block size:'

Then do a filesystem check (resize2fs will not work without it):
e2fsck -f /dev/hda1
Expect it to take some time to run… (depends on partition size)

Make sure that you calculate the block size correctly. df shows the block size as each block=1024.
resize2fs /dev/hda1 36250000

Then use fdisk to delete the partition and recreate it with the new size. The newly freed space is then available to you in order to create a second partition.

DRBD installation from source

backup and filesystems No Comments »

Prepare kernel source
cd /usr/src/linux
make mrproper
cp /boot/config-2.4.some-thing .config

Edit the Makefile to make sure the EXTRAVERSIONS constant reflects the stock kernel naming
vi Makefile

Now prepare the kernel sources to be ready for compiling modules against it
make -s oldconfig_nonint ; make -s oldconfig_nonint
make dep
make include/linux/version.h

Compile DRBD
wget http://oss.linbit.com/drbd/0.7/drbd-0.7.10.tar.gz
tar xfz drbd-0.7.10.tar.gz
cd drbd-0.7.10
make all
make install

Probably the devide nodes were not setup so far. We have to do this as well
for i in `seq 0 15` ; do mknod -m 0660 /dev/drbd$i b 147 $i; done

Setup first node with a new partition
/etc/init.d/drbd start
drbdadm up all
drbdadm -- --do-what-I-say primary all
mke2fs /dev/drbd0
tune2fs -j /dev/drbd0

Automatically start DRBD partition on bootup
ln -s /etc/init.d/drbd /etc/rc3.d/S29drbd
ln -s /etc/init.d/drbd /etc/rc3.d/K29drbd
vi /etc/fstab -> /dev/drbd0 /ha ext3 defaults 0 0

DRBD Links

backup and filesystems No Comments »

DRDB_QuickStart
DRBD_2fHowTo_2fInstall
DRBD Background
http://wiki.linux-ha.org/DRBD

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in