Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Apr 2013 20:29:24 +0200
From:      "Thomas Schmitt" <scdbackup@gmx.net>
To:        freebsd-stable@freebsd.org
Subject:   Re: Release ISO images have broken RockRidge data
Message-ID:  <4267633373880852212@scdbackup.webframe.org>

next in thread | raw e-mail | index | archive | help
Hi,

Warren Block wrote:
> sync will support hard links with -H

But how shall rsync know that the files in the ISO image stem from
hardlink siblings on the hard disk where the image was produced ? 

--------------------------------------------------------------------

I succeeded with this post-processing on a Linux system with bash
after xorriso -for backup ... -extract / livefs :

Learn the block address of content of /rescue/cat in the ISO image:

  lba=$(xorriso -indev ../FreeBSD-8.4-BETA1-amd64-livefs.iso \
                -find /rescue/cat -exec report_lba -- 2>/dev/null | \
        fgrep cat | \
        awk '{print $6}')

(Should yield 35682 with that image)

Get a list of all files with that block address, except /rescue/cat :

  siblings=$(xorriso -indev ../FreeBSD-8.4-BETA1-amd64-livefs.iso \
                     -find / -sort_lba -lba_range "$lba" 1 \
                             -exec report_lba -- \
                2>/dev/null | \
             grep '^File data lba' | awk '{print $12}' | \
             sed -e "s/'//g" | grep -v '^/rescue/cat$' )

(This should yield 137 files:
   /rescue/[ ... /rescue/zpool
)

Delete them in livefs/ and re-create them as links to livefs/rescue/cat:

  for i in $siblings
  do
    rm livefs$i
    ln livefs/rescue/cat livefs$i
  done


This brings the size of livefs/rescue from 676772 KiB to 4924 KiB.
ls -l livefs/rescue reports:

  total 676768
  -r-xr-xr-x 138 thomas thomas 5007184 2013-03-20 04:14 [
  -r-xr-xr-x 138 thomas thomas 5007184 2013-03-20 04:14 atacontrol
  ...
  -r-xr-xr-x 138 thomas thomas 5007184 2013-03-20 04:14 zpool

--------------------------------------------------------------------

(Confessedly one could get the file list as well by ls -l and grepping
 for the size of livefs/rescue/cat.)

--------------------------------------------------------------------


Have a nice day :)

Thomas




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4267633373880852212>