Installing FreeBSD from USB flash drive - some experiments

army.of.root army.of.root at googlemail.com
Wed Mar 11 09:00:50 PDT 2009


Andrew Snow wrote:
> 
> Here's the steps I use to create a 1GB USB image:
> 
> # dd if=/dev/zero of=bootable.image bs=1m count=1 oseek=1000 conv=sparse
> # mdconfig -a -t vnode -f bootable.image -u 0
> # newfs -m 0 -o space -n /dev/md0
> # mount /dev/md0 /mnt
> 
> # cd /usr/src
> # make installworld DESTDIR=/mnt
> # make distribution DESTDIR=/mnt
> # make installkernel DESTDIR=/mnt
> # umount /mnt
> 
> At this point you have a file "bootable.image" but instead of actually 
> making that a bootable dd image, I choose to create a dump file which is 
> a bit more flexible as you can restore it to a USB stick of any size.
> 
> # dump -0 -C 8 -f - /dev/md0 | gzip -9 > bootable.dump.gz
> # mdconfig -d -u 0
> 
> 
> At this point, you have a dump file which you can use to create a 
> bootable USB as follows:
> 
> Assuming the USB stick is /dev/da0 !
> 
> # dd if=/dev/zero of=/dev/da0 bs=16k
> # fdisk -BI /dev/da0
> # disklabel -B -w /dev/da0s1
> # newfs -m 0 -o space -n /dev/da0s1a
> # mount -o noatime,async /dev/da0s1a /mnt
> # gzcat bootable.dump.gz | ( cd /mnt ; restore -rvf - )
> # umount /mnt
> 
> 
> 
> Hope that helps
> 
> 
> - Andrew

Hi,

I didnt test this specific soulution, but I did something similar some time 
ago. Could you put this sketch somewhere visible on the web? - Like the Wiki or 
maybe open a thread in the Forum.

Thanks :)


More information about the freebsd-stable mailing list