Using A USB Removable Disk Drive For BackupRestore
Using A USB Removable Disk Drive For BackupRestore
removable disk backup and restore of files on the AIX and Linux Power Platforms
using the new USB Removable Disk Drive for Backup/Restore. The backup and
restore are done using standard AIX and Linux commands.
- Easily installed in an existing half high media bay in many Power Systems
or externally via an external USB port on a Power System.
- The USB Removable Disk Drive cartridge is as easily installed and
removed from the USB Removable Disk Drive dock as a tape data
cartridge without the delay in load or unload time found with many tape
drives.
- AIX supports this device with many of the same commands used to
backup data to a tape drive, such as:
o mksysb
o Backup and restore
o tar
o dd
o cpio
- AIX mksysb images backed up to the USB removable disk drive for
backup/restore are directly bootable from the SMS menu.
- Linux supports the USB Removable Disk Drive for Backup/Restore as a
standard disk drive, using standard Linux commands for copy, backup and
restore.
- Eliminates the need for cleaning cartridges required for tape drives.
- Less effected by harsh environments which effect tape drives(dusty, high
traffic areas), such as found in some office environments.
- Can repeatedly be used for small repetitive backups or large daily, weekly
or monthly backups.
- Compliments a tape backup solution for those customers requiring both
tape and disk backup solutions.
- System administrators are already familiar with copying files and the
Universal Disk Format(UDF) file system.
AIX
Note: User may see increase performance and decrease backup time by doing one or
more of the following:
o Use the drive as a “raw” device such as rusbms0 vs usbms0.
o Use a large blocking factor such as the “–b512” with the mksysb or the –N512
with the tar command, By increasing the blocking factor AIX reduces the number
of writes it takes to write the data to the data cartridge.
o The "kernel_heap_psize" tunable value to increase the default variable to 64KB if
it is not at least this size already.
mksysb -i /dev/usbms0
smitty (enter)
listvgbackup -f /dev/usbms0
lsmksysb -f /dev/usbms0
lssavevg -f /dev/usbms0
lssavewpar -f /dev/usbms0
- To backup all the files and subdirectories in the /home directory using full path names:
find /home -print | backup -i -f /dev/usbms0
- To backup all the files and subdirectories in the /home/mikectory directory using
relative path names
cd /home/mikectory
find . -print | backup -i -v -q -f /dev/usbms0
- To restore a specific directory and the contents of that directory from a file-
name archive
Sample Backup to add files after backing up the root file system with a mksysb:
- To add files to a file system on the usbms it is necessary to mount the file
system that was previously created, then either copy, backup, tar, dd, or cpio
the additional files to the mounted file system.
mount -v udfs /dev/usbms0 /mnt
(note that the mksysb would be /mnt/usr/sys/inst.images/mksysb_image)
tar –cvf /mnt/usr/whatever /whatever
- To "tar" a directory:
tar -cvf /dev/usbms0 /usr
Compare files:
- To compare the original and the copy file use the AIX command "cmp".
cmp /tmp/cdi_0844A_61F /tmp/readback/cdi_0844A_61F
The "cmp" command completes without errors and without showing a difference.
Cleanup:
cd /tmp
rm -r ./readback
savevg -i -f /dev/usbms0
restwpar -f /dev/usbms0
Restore a partition
- To read the backup stored at /dev/usbms0 and restore all files to the /data/myfiles
directory, enter the following command:
restvg -f /dev/usbms0
Linux
Note: The -b on the backup increases the blocking factor on the write and and
using a -b 500 can reduce the time it takes to backup the files.
cd /etc
ls | backup -ivq -b 500 -f /dev/sbx
To backup all the files and subdirectories in the /home directory using full path
names:
To backup all the files and subdirectories in the /home/mikectory directory using
relative path names
cd /home/mikectory
find . -print | backup -i -v -q -f /dev/sbx
cd /
backup -0 -u -f /dev/sbx
back up a file with "backup"
cd /tmp
echo ./cdi_0844A_61F | time backup -iqvf /dev/sbx
The Restore Command extracts files from archives created with the backup command.
cd /etc
restore -Tvqf /dev/sbx
cd /
find . -print | cpio -ov >/dev/sbx
Note: The -N on the backup increases the blocking factor on the write and and using a -
N500 can reduce the time it takes to backup the files.
cd /
tar -cvf /dev/sbx /
To "tar" a directory:
To restore a specific directory and the contents of that directory from a file-name
archive
AIX:
Linux:
Note: The file system doesn't have to be ext2, it can be other filesystems such as
ext3, reiserfs, etc
Create a directory
$mkdir rdx_drive
Then mount the directory to the target device
$mount /dev/sdf rdx_drive
Assuming that you are just copying files over to the RDX so that is a simple copy
command
$cp file(s) rdx_drive
Display the files on the RDX?
Use the list command "ls"
$ls rdx_drive/*
To eject the Disk Drive first unmount the device
$umount rdx_drive
A mount of the device without any Disk Drive's in the Dock will get a "mount:
No medium found" error
$mount /dev/sdf rdx_drive/
mount: No medium found