From owner-freebsd-questions Sat Jul 6 8:24: 4 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB0C037B400 for ; Sat, 6 Jul 2002 08:23:57 -0700 (PDT) Received: from zim.0x7e.net (zim.0x7e.net [203.38.184.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AA8343E31 for ; Sat, 6 Jul 2002 08:23:50 -0700 (PDT) (envelope-from listone@deathbeforedecaf.net) Received: from goo.0x7e.net ([203.38.184.164] helo=goo) by zim.0x7e.net with smtp (Exim 3.33 #1) id 17QrQf-000IxD-00 for freebsd-questions@freebsd.org; Sun, 07 Jul 2002 00:54:57 +0930 Message-ID: <000e01c22501$26e349e0$a4b826cb@goo> From: "Rob" To: Subject: Backups to CD-R - problems with filesystems Date: Sun, 7 Jul 2002 00:53:58 +0930 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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