Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jul 2002 00:53:58 +0930
From:      "Rob" <listone@deathbeforedecaf.net>
To:        <freebsd-questions@freebsd.org>
Subject:   Backups to CD-R - problems with filesystems
Message-ID:  <000e01c22501$26e349e0$a4b826cb@goo>

next in thread | raw e-mail | index | archive | help
I've had a few adventures in recent days trying to make CD-R backups. In
case I've gone down a complete dead-end, here's the objective:

* Copy selected directory trees from 3 FreeBSD systems onto CD as a
  mountable filesystem (not a monolithic archive)

The first challenge was to get the files onto 1 machine (with a CD burner).
I tried piping tar through ssh

  goo# ssh gir 'cd / ; tar -cf - boot etc home usr/local/etc' |
       ( cd gir && tar -xpf - )

but discovered that it misbehaves when the users in a tarfile don't exist
on the destination machine. Instead of leaving the files with numeric
owners, it chowns them to the user performing the extraction.

I couldn't find any options to fix this - same-permissions and same-owner
didn't seem to make a difference.

I found success with pax (does anyone actually use this?)

  goo# ssh gir 'cd / ; pax -w boot etc home usr/local/etc' |
       ( cd gir && pax -rpe )
  goo# ssh zim 'cd / ; pax -w boot etc home usr/local/etc' |
       ( cd zim && pax -rpe )
  goo# ( cd / ; pax -w boot etc home usr/local/etc ) |
       ( cd goo && pax -rpe )

So now I had a directory containing the saveworthy parts of 3 systems.
Next challenge: get them onto a CD.

The usual way to do this is with mkisofs and burncd (I'm using an ATA
writer). I installed mkisofs-1.14 and tried to build the image

  goo# mkisofs -R -U -o /tmp/image.iso *

but ended up with lots of errors like

  mkisofs: Error: goo/boot/boot0 and zim/boot/boot0 have the same Rock Ridge name
  mkisofs: Error: goo/boot/boot0 and gir/boot/boot0 have the same Rock Ridge name
  mkisofs: Error: zim/boot/boot0 and gir/boot/boot0 have the same Rock Ridge name
  . . .
  mkisofs: Unable to sort directory gir/boot

After some googling, it looks like this is also a known issue. I tried
using unrestricted IS09660 without RockRidge, but that threw away things
like symlinks.

So I decided to give up on ISO, and build a nice simple FFS image instead.
My first attempt used a filesystem on a vnode

  goo# dd if=/dev/zero of=image bs=2k count=350k
  358400+0 records in
  358400+0 records out
  734003200 bytes transferred in 21.955657 secs (33431165 bytes/sec)
  goo# vnconfig -s labels -c vn0 image
  goo# disklabel -r -w vn0 auto
  goo# newfs vn0c
  /dev/vn0c: 1433600 sectors in 350 cylinders of 1 tracks, 4096 sectors
  700.0MB in 22 cyl groups (16 c/g, 32.00MB/g, 7936 i/g)
  super-block backups (for fsck -b #) at:
  32, 65568, 131104, 196640, 262176, 327712, 393248, 458784, 524320, 589856,
  655392, 720928, 786464, 852000, 917536, 983072, 1048608, 1114144, 1179680,
  1245216, 1310752, 1376288
  goo# mount /dev/vn0c `pwd`/mount

and after copying the files into the mounted filesystem, wrote the vnode
file to CD

  goo# umount `pwd`/mount
  goo# burncd -f acd1 -s 12 -et data image fixate

but when I tried to mount the CD-ROM on another machine, I got an error

  zim# mount -t ufs -r /dev/acd0c /cdrom
  mount: /dev/acd0c on /cdrom: incorrect super block

I had a look at the start of the CD using hexdump, and compared it to a
disk filesystem

  goo# hd -n 10240 /dev/acd0c
  00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  *
  00000200 57 45 56 82 00 00 00 00 61 6d 6e 65 73 69 61 63 |WEV.....amnesiac|
  00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  00000220 00 00 00 00 00 00 00 00 00 02 00 00 20 00 00 00 |............ ...|
  00000230 40 00 00 00 bc 02 00 00 00 08 00 00 00 e0 15 00 |@...............|
  00000240 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................|
  00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  *
  00000280 00 00 00 00 57 45 56 82 cf 08 08 00 00 20 00 00 |....WEV...... ..|
  00000290 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |. ..............|
  000002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  000002b0 00 00 00 00 00 e0 15 00 00 00 00 00 00 04 00 00 |................|
  000002c0 07 08 10 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  000002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  *
  00002000 00 00 00 00 00 00 00 00 10 00 00 00 18 00 00 00 |................|
  00002010 20 00 00 00 00 04 00 00 00 08 00 00 ff ff ff ff | ...............|
  00002020 b2 a1 26 3d 00 f0 0a 00 4f 99 0a 00 16 00 00 00 |..&=....O.......|
  00002030 00 20 00 00 00 04 00 00 08 00 00 00 08 00 00 00 |. ..............|
  00002040 00 00 00 00 3c 00 00 00 00 e0 ff ff 00 fc ff ff |....<...........|
  00002050 0d 00 00 00 0a 00 00 00 0f 00 00 00 00 08 00 00 |................|
  00002060 03 00 00 00 01 00 00 00 00 08 00 00 00 fe ff ff |................|
  00002070 09 00 00 00 00 08 00 00 40 00 00 00 02 00 00 00 |........@.......|
  00002080 00 00 00 00 00 10 00 00 01 00 00 00 00 00 00 00 |................|
  00002090 4c 92 26 3d 98 80 2c 24 00 04 00 00 00 04 00 00 |L.&=..,$........|
  000020a0 00 18 00 00 01 00 00 00 00 10 00 00 00 10 00 00 |................|
  000020b0 5e 01 00 00 10 00 00 00 00 1f 00 00 00 80 00 00 |^...............|
  000020c0 59 02 00 00 15 d3 00 00 93 91 02 00 e5 00 00 00 |Y...............|
  000020d0 00 01 00 00 2f 76 61 72 2f 73 70 6f 6f 6c 2f 63 |..../var/spool/c|
  000020e0 64 72 6f 6d 2d 69 6d 61 67 65 73 2f 6d 6f 75 6e |drom-images/moun|
  000020f0 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |t...............|
  00002100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  *
  000022d0 00 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 |................|
  000022e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  . . .
  goo# hd -n 10240 /dev/ad0s1g
  00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  *
  00002000 00 00 00 00 00 00 00 00 10 00 00 00 18 00 00 00 |................|
  00002010 20 00 00 00 00 04 00 00 00 08 00 00 ff ff ff ff | ...............|
  00002020 a5 b4 26 3d 4b cd 46 00 18 9e 44 00 8e 00 00 00 |..&=K.F...D.....|
  00002030 00 20 00 00 00 04 00 00 08 00 00 00 08 00 00 00 |. ..............|
  00002040 00 00 00 00 3c 00 00 00 00 e0 ff ff 00 fc ff ff |....<...........|
  00002050 0d 00 00 00 0a 00 00 00 0f 00 00 00 00 08 00 00 |................|
  00002060 03 00 00 00 01 00 00 00 00 08 00 00 00 fe ff ff |................|
  00002070 09 00 00 00 00 08 00 00 40 00 00 00 02 00 00 00 |........@.......|
  00002080 00 00 00 00 00 10 00 00 01 00 00 00 00 00 00 00 |................|
  00002090 06 94 7a 3c 44 01 57 2f 00 04 00 00 00 0c 00 00 |..z<D.W/........|
  000020a0 00 18 00 00 01 00 00 00 00 10 00 00 00 10 00 00 |................|
  000020b0 da 08 00 00 10 00 00 00 00 1f 00 00 00 80 00 00 |................|
  000020c0 52 00 00 00 d2 be 03 00 a6 30 11 00 48 02 00 00 |R........0..H...|
  000020d0 00 00 00 02 2f 68 6f 6d 65 00 00 00 00 00 00 00 |..../home.......|
  000020e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  *
  000022d0 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 |................|
  000022e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
  . . .

It looked like the part from 0x2000 was similar, but the disk had zeros
beforehand while the CD had data. So I made another image with zeros in
the first 8k (obviously with no actual knowledge of filesystems :-)

  goo# ( dd if=/dev/zero bs=2k count=4 ; dd if=/dev/vn0c bs=2k skip=4 ) |
       burncd -f /dev/acd1c -s 12 -e data - fixate

and tried again

  zim# mount -t ufs -r /dev/acd0c /cdrom
  mount: /dev/acd0c on /cdrom: incorrect super block

but the result was the same.

At this point I'm stuck - all I want is a nice simple filesystem on CD,
that I can mount as needed.... has anyone come up with a better way of
doing this?

Thanks
Rob.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000e01c22501$26e349e0$a4b826cb>