another stupid dump question

Andrew Mathews andrew_mathews
Mon May 17 11:47:16 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Wunder wrote:
<snip>
| <heavy sigh>
| I don't get this at all. Either my version of dump doesn't support
this, or
| I'm doing something wrong...
|
| When I execute
| /sbin/restore -if /dev/st0 /home/
| I'm immediately plopped into an interactive restore of /, which is the
first
| dumped partition.
| My dump script is painfully simple right now, executing the following:
| /sbin/dump 0uf /dev/nst0 /
| /sbin/dump 0uf /dev/nst0 /home
| /sbin/dump 0uf /dev/nst0 /var
|
| a cat of /etc/dumpdates tells me everything was dumped:
| # cat /etc/dumpdates
| /dev/sda1 0 Tue May 13 01:01:00 2003
| /dev/sda5 0 Tue May 13 01:03:23 2003
| /dev/sda7 0 Tue May 13 02:22:31 2003
|
| Using dump/restore version 0.4b25
|
| Regards,
| Tim
|

Not your fault. I did a cut and paste from the wrong screen I guess.
What you're missing is the file space forward (fsf) to get to the next
volume. As an example, (with comments) this Sun E250 uses the following
mountpoints:
/dev/sda4 on / type ext3 (rw) #first dump (starting point)
/dev/sda1 on /boot type ext3 (rw) #second dump (fsf 1)
/dev/sda5 on /home type ext3 (rw) #third dump (fsf 2)
/dev/sda2 on /usr type ext3 (rw) #fourth dump (fsf 3)
/dev/sdb1 on /var type ext3 (rw) #fifth dump (fsf 4)
So your first attempt will be a restore of / . To access your second
dump, use "mt -f /dev/nst0 fsf 1" You're now at your second file (dump).
Repeat as necessary. Keep in mind that if, for instance, here /tmp is
part of / and not a separate mountpoint, you need to traverse to it from
it's actual dump hierarchy, so to restore /tmp, you need to do it from
the dump of / . Separate mountpoints will be empty in / . An example below:
###################################
[root at logger /]# /sbin/restore -if /dev/nst0
Dump tape is compressed.
/sbin/restore > ls
.:
.autofsck   dev/        initrd/     lost+found/ proc/       tmp/
bin/        etc/        lib/        mnt/        root/       usr/
boot/       home/       lib64/      opt/        sbin/       var/
/sbin/restore > quit
[root at logger /]# mt -f /dev/nst0 fsf 1
[root at logger /]# /sbin/restore -if /dev/nst0
Dump tape is compressed.
/sbin/restore > ls
.:
System.map                            module-info-2.4.19-0.004sparc
System.map-2.4.19-0.004sparc          old.b
cd.b                                  second.b
fd.b                                  silo.conf
first.b                               silotftp.b
ieee32.b                              ultra.b
initrd-2.4.19-0.004sparc.img          vmlinux-2.4.19-0.004sparc
kernel.h                              vmlinux-2.4.19-0.004sparc-UNSTRIPPED
lost+found/                           vmlinuz
module-info                           vmlinuz-2.4.19-0.004sparc
/sbin/restore > quit
[root at logger /]#
#######################################
Now to restore a file, such as /usr/local/etc/logcheck.ignore:
#######################################
[root at logger /]# mt -f /dev/st0 rewind
[root at logger /]# mt -f /dev/nst0 fsf 3
[root at logger /]# cd /usr/
[root at logger usr]# ls -l local/etc/
total 28
- -rw-------    1 root     root         1037 Oct 25  2002 logcheck.hacking
- -rwx------    1 root     root        10654 May  6 14:48 logcheck.sh
- -rw-------    1 root     root          407 Oct 25  2002 
logcheck.violations
- -rw-------    1 root     root           27 Jan 27 07:04
logcheck.violations.ignore
drwx------    2 root     root         4096 May 13 14:30 tmp
[root at logger usr]# /sbin/restore -if /dev/nst0 .
Dump tape is compressed.
/sbin/restore > add local/etc/logcheck.ignore
/sbin/restore: ./local: File exists
/sbin/restore: ./local/etc: File exists
/sbin/restore > extract
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume # (none if no more volumes): 1
set owner/mode for '.'? [yn] y
/sbin/restore > quit
[root at logger usr]# ls -l local/etc/
total 32
- -rw-------    1 root     root         1037 Oct 25  2002 logcheck.hacking
- -rw-------    1 root     root         1477 May  9 12:37 logcheck.ignore
- -rwx------    1 root     root        10654 May  6 14:48 logcheck.sh
- -rw-------    1 root     root          407 Oct 25  2002 
logcheck.violations
- -rw-------    1 root     root           27 Jan 27 07:04
logcheck.violations.ignore
drwx------    2 root     root         4096 May 13 15:00 tmp
[root at logger usr]#
#########################################

It's a bit of a long reply, but I hate to give advice with no example.
You can also use "-iaf" instead of "-if" to bypass the volume prompting.
Also note that you'll only have 1 volume (volume 1) on the tape.
Hope this clarifies it a bit more.
- --
Andrew Mathews
- ---------------------------------------------------------------------
~ 12:53pm  up 31 days, 21:18, 13 users,  load average: 2.71, 2.58, 2.34
- ---------------------------------------------------------------------
Euch ist becannt, was wir beduerfen;
Wir wollen stark Getraenke schluerfen.
		-- Goethe, "Faust"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org

iD8DBQE+wWMnejAu2RVHwF4RAgqUAJ0QJqoJHum5q+qSAanLfVgGgPKGJwCfRzc9
qhYQB9iFT4N6rjPxRymLMq0=
=VZjY
-----END PGP SIGNATURE-----



More information about the Linux-users mailing list