DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4 Weeks Ago
tetra_user tetra_user is offline
New User
 
Join Date: Jun 2014
Posts: 9
Thanked 0 Times in 0 Posts
Default Bootable OpenBSD system image

Hi ,

Is it possible to make a raw bootable image (.img) from a working OpenBSD installation. My OS size is under 1GB . Kindly advise.


Thank you.
Reply With Quote
  #2   (View Single Post)  
Old 4 Weeks Ago
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,873
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by tetra_user View Post
Is it possible to make a raw bootable image (.img) from a working OpenBSD installation. My OS size is under 1GB.
Why not install directly to the ultimate target storage device? This is also mentioned in Section 14.17.3 of the FAQ.

Last edited by ocicat; 4 Weeks Ago at 09:54 PM.
Reply With Quote
  #3   (View Single Post)  
Old 4 Weeks Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,608
Thanked 214 Times in 189 Posts
Default

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; 4 Weeks Ago at 01:52 AM. Reason: two typos
Reply With Quote
  #4   (View Single Post)  
Old 4 Weeks Ago
tetra_user tetra_user is offline
New User
 
Join Date: Jun 2014
Posts: 9
Thanked 0 Times in 0 Posts
Default

thank you. Much appreciated!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT. The time now is 07:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick