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

_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to