creating images under linux
creating images under linux
Hello, I was wondering what tools and methods people use to create images of their OSes under linux. I want to create an image that consists of bootsector and my kernel all located linearly on a floppy disk. I dont want a filesystem, I want the bootloader to be first sector and the remaining sectors to be the kernel. I dont have a floppy drive, and am working with data images created from bochs bximage. Any ideas?
Re: creating images under linux
Searching for "images" on the Wiki turned up the page Disk Images which sums it up nicely.
Personally, I used 'dd' and the loopback device for the job.
Personally, I used 'dd' and the loopback device for the job.
Every good solution is obvious once you've found it.
Re: creating images under linux
I am using dd now as well, but I dont know how to use it too well. The problem is, if you have boot.bin and kernel.bin, and use dd on the same image, kernel.bin will overwrite boot.bin. Is there anyway to have dd start copying starting on the second sector?
Re: creating images under linux
$man dd
Note the 'seek' option.
Code: Select all
DD(1) User Commands DD(1)
NAME
dd - convert and copy a file
SYNOPSIS
dd [OPERAND]...
dd OPTION
DESCRIPTION
Copy a file, converting and formatting according to the operands.
bs=BYTES
force ibs=BYTES and obs=BYTES
cbs=BYTES
convert BYTES bytes at a time
conv=CONVS
convert the file as per the comma separated symbol list
count=BLOCKS
copy only BLOCKS input blocks
ibs=BYTES
read BYTES bytes at a time
if=FILE
read from FILE instead of stdin
iflag=FLAGS
read as per the comma separated symbol list
obs=BYTES
write BYTES bytes at a time
of=FILE
write to FILE instead of stdout
oflag=FLAGS
write as per the comma separated symbol list
seek=BLOCKS
skip BLOCKS obs-sized blocks at start of output
skip=BLOCKS
skip BLOCKS ibs-sized blocks at start of input
status=noxfer
suppress transfer statistics
BLOCKS and BYTES may be followed by the following multiplicative suffixes: xM M, c 1, w 2, b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and
so on for T, P, E, Z, Y.
Every good solution is obvious once you've found it.
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: creating images under linux
you can use qemu-img , if you use qemu ........
Regards
Shrek
Regards
Shrek
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: creating images under linux
Also, if you are copying onto an image with an existing filesystem that you want to preserve, you may want to use conv=notrunc. If you don't anything past the blocks you wrote gets deleted.