1846992 Members
3180 Online
110257 Solutions
New Discussion

cpio raw device

 
Kenneth Yap
Frequent Advisor

cpio raw device

Dear Experts,

How can I use cpio to backup my raw logical volume (rlvol) ?
Total I have 100 over rlvol in diference VG.
9 REPLIES 9
Robert-Jan Goossens
Honored Contributor

Re: cpio raw device

Hi,

Never used cpio on a raw volume, check this link form more info.

http://www.backupcentral.com/native-backup-utils.html

Hope this helps,
Robert-Jan
Sunil Sharma_1
Honored Contributor

Re: cpio raw device

I don't think you can use cpio for raw volumes.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Cesare Salvioni
Trusted Contributor

Re: cpio raw device

cant use cpio, use dd instead
Marvin Strong
Honored Contributor

Re: cpio raw device

To my knowledge, cpio can't do raw, you must use dd. As stated by others.

Leif Halvarsson_2
Honored Contributor

Re: cpio raw device

Hi,
With as many as 100 raw devices to back up you should look for a better tool then dd, for example HP Data Protector (it is possible to backup raw devices with DP).
Kenneth Yap
Frequent Advisor

Re: cpio raw device

For temporaly, we need to use command to do backup. The server will move to new place then have the Data Protector backup software. Any other command can be use ?or free ware
Bill Hassell
Honored Contributor

Re: cpio raw device

cpio backs up files. There are no files in a raw volume. You can use dd but be prepared to keep VERY careful records and log everything you do. Restoring a specific raw volume from tape to disk could cause a LOT of problems if the records are not accurate. dd saves nothing on the tape except the raw data, not even a date or source information. If this is important data, do not use dd. Instead, purchase a professional backup program such as HP's Data Protector.


Bill Hassell, sysadmin
Dani Seely
Valued Contributor

Re: cpio raw device

Hey Kenneth,
I don't believe you can use cpio to backup raw volumes, as previously stated. The use of dd should work. dd reads and writes data by blocks, and can convert the data between formats.

Be careful though, as misuse of dd has probably trashed many hard disks and file systems. Before doing this, BACKUP YOUR SYSTEM (via Ignite or similar). Do a 'man dd' or perform:
$ dd --help
Together We Stand!
Hein van den Heuvel
Honored Contributor

Re: cpio raw device


For similar tasks I use a perl script similar to the one attached and included below.
It may serve you as a starting point.
I starts a controllable number of concurrent dd commands, piping output into a compress tool.
I feed it a file of files.
The file of files is generally organized, sorted by descending size so that you do not have to wait for the longest file at the end.
I also try to rotate through vg's, trying to avoid starting all jobs from a single vg.
I gave the output numbers as name dirived from the entry in the file of files, but you could ofcourse mung the raw device name into a useable filename (vgxx_lvyy.gz).
The file should probably capture the dd 'records input' output from STDERR but it does not for now.
This version prints the start time, stop time, elapsed time, stream used, pid used, file number and file name for each file.
(Oops, did not include final streams, oh well, left as exercise to reader!)
This version is for tests only and thus limits the data volume with count=40 on the dd line.
In my own versions I derive max-streams from the cpu count and also use mpsched to force cpu affinity as I 'own' the box.

waddayathink?
Hein.

$file = shift or die "Must provide file of files";
$max_streams = shift (@ARGV);
$max = ($max_streams)? int ($max_streams) : 4;

open (FILE, $file) || die "Error open file of files: $file";
while () {
$num++;
chop;
if ($par++ >= $max) {
$pid = wait();
$par--;
$s = 1;
$s++ while (($stream[$s] != $pid) && ($s <= $max) );
printf("%02d:%02d:%02d %04X %5d %s\n",
$hour,$min,$sec,$pid,time() - $time[$s], $file[$s]);
die "Lost child process ?" if ($s > $max);
} else {
$s = $par;
}
$pid = fork();
if ($pid) {
$stream[$s] = $pid;
$file[$s] = sprintf ("%02d %3d %s",$s,$num,$_);
$time[$s] = time();
} else {
($sec,$min,$hour) = localtime(time);
printf("%02d:%02d:%02d %04X BEGIN %02d %3d %s\n",
$hour,$min,$sec,$$,$s,$num,$_);
exec ("dd bs=1024k count=40 if=$_ | gzip > /backup/hein/$num.gz")
}
}
close (FILE);
print "Last job started\n";
$pid = wait() while (--$par > 0);
print "Last job (pid=$pid) ended\n";
;