Making a custom FreeBSD iso

Giorgos Keramidas keramida at ceid.upatras.gr
Sat Jun 18 20:07:45 GMT 2005


On 2005-06-18 21:12, Wojciech Puchar <wojtek at tensor.3miasto.net> wrote:
>> Im ripping the iso image from the cd with dd
>>
>> dd if=/dev/acd0 of=file.iso bs=2048
>>
>> Then, Im mounting the iso image
>>
>> mdconfig -a -t vnode -f /usr/iso-orig/file.iso -u 0
>>
>> mount -t cd9660 /dev/md0 /iso
>>
>> ..and copying its contents to disk with cp -R
>
> tar cf - .|(cd /newdir;tar xpf -) would be better and copy all dev's
> etc properly.

True.  This will also copy hard links as hard links, which seems to be
bitting the previous poster.  Just using cp(1) is not enough some times:

% gothmog:/tmp/foo$ mkdir src dst
% gothmog:/tmp/foo$ echo hello world > src/0
% gothmog:/tmp/foo$ for linkcount in `jot 100 1 100`; do link src/0 src/$linkcount; done
% gothmog:/tmp/foo$ du -sk src dst
% 4       src
% 2       dst
% gothmog:/tmp/foo$ cp -Rp src/* dst/
% gothmog:/tmp/foo$ du -sk src dst
% 4       src
% 204     dst

On the other hand, tar(1) can help a lot:

% gothmog:/tmp/foo$ mkdir dst2
% tar: Error opening archive: Empty input file: Inappropriate file type or format
% gothmog:/tmp/foo$ tar -c -C src -f - . | tar -xv -C dst2 -f -
% x .
% x 0
% [...]
% x 98
% x 99
% x 100
% gothmog:/tmp/foo$ du -sk src dst*
% 4       src
% 204     dst
% 4       dst2
% gothmog:/tmp/foo$

> >Now, all of the sudden, the /rescue dir grows from 3.5M to 455M so after i
> >copy my scripts to the extracted iso filesystem on my hard disk and try to
> >make an iso I cannot burn the ISO because its way too big. Can anyone help
> >me with this?
>
> iso9660 doesn't have links marked as links. just relink them all
> same-sized files to one

Or just scratch the existing (cp -R) copy of the ISO files and start
over with tar, cpio or any tool that knows how to deal with hard links :)



More information about the freebsd-questions mailing list