Last edited by ocicat; 22nd June 2014 at 09:54 PM.
The TL;DR answer is "yes, but..."
There are two options.
1) You could replicate the drive with dd(1) if the destination device is the same size or larger, and if it has the same sector size. If you use this option, replicate the raw device. Don't copy an open filesystem -- so this is best done from the RAMDISK kernel
example: # dd if=/dev/rsd0c of=/dev/rsd1c bs=1m
2) The more flexible option is to manually configure the destination device. It can be physically smaller, and have a different sector size. For MBR architectures, fdisk(8) is used to create an MBR, and installboot(8) is used for writing the boot blocks.
The example here uses tar(1) for copying, other tools are also usable, such as dump/restore, pax, or cpio. This tar example shown can be used from the RAMDISK kernel.
example (assumes a single "a" partition and an MBR architecture)
# fdisk -iy sd1
# disklabel -E sd1 [configure as you like]
# newfs sd1a
# mkdir in out
# mount /dev/sd0a in
# mount -o async,noatime /dev/sd1a out
# (cd in; tar cf - .) | (cd out; tar xpf -)
# cd in/usr/mdec
# ./installboot -v -r ../out sd1 biosboot boot
Nothing here was tested. Don't blindly copy/paste anything.
Last edited by jggimi; 23rd June 2014 at 01:52 AM. Reason: two typos
|Thread||Thread Starter||Forum||Replies||Last Post|
|Using Qemu for creating bootable usb when wireless is needed||Ninguem||Guides||2||26th January 2013 12:23 AM|
|OpenBSD's version of the X Window System||Zyos||OpenBSD Security||4||7th November 2011 12:04 AM|
|trouble creating freeBSD bootable usb||aenimansot||FreeBSD Installation and Upgrading||1||11th September 2011 03:12 AM|
|How to Create a Bootable CD from an .iso file||rtwingfield||FreeBSD Installation and Upgrading||4||22nd June 2010 10:08 AM|
|make iso bootable from USB stick||ccc||FreeBSD General||2||30th October 2008 02:28 AM|