how can i write specific sectors on a floppy? for example...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
solarwind
Posts: 1
Joined: Tue Aug 30, 2005 11:00 pm

how can i write specific sectors on a floppy? for example...

Post by solarwind »

lets say i have three files:

fileone
filetwo
filethree

i need to write:

fileone to sector 0 to floppy
filetwo to sector 1 to floppy
filethree to sector 4 to floppy

how can i do this in linux?

i know that the linux dd command can write sectors but i only managed to get the first file on the floppy and boot like this

dd if=fileone bs=512 of=/dev/fd0

but i cant get the rest of the files on...
is there a way to do this?

if anyone can respond i will greatly appreciate this

thanks in advance!
blackcatcoder
Member
Member
Posts: 132
Joined: Wed Nov 03, 2004 12:00 am
Location: Austria
Contact:

Re: how can i write specific sectors on a floppy? for exampl

Post by blackcatcoder »

there are many ways to get files on disc!

dd is very simple!

my advice is :

create a file where all the files are written with the 512 byte align and then wrtie it with dd to an disc!

dd if=binary_image of=/dev/fd0

it would be the easiest way, for now!

all other things can only be managed with a little fs like FAT or a self coded one!
rexlunae
Member
Member
Posts: 134
Joined: Sun Oct 24, 2004 11:00 pm
Location: North Dakota, where the buffalo roam

Re: how can i write specific sectors on a floppy? for exampl

Post by rexlunae »

blackcatcoder wrote:create a file where all the files are written with the 512 byte align and then wrtie it with dd to an disc!
I think it would be simpler to use the seek option for dd.

Code: Select all

seek=n   Seek n blocks from the beginning of the output before copying.
              On non-tape devices, an lseek(2) operation is used.  Otherwise,
              existing blocks are read and the data discarded.  If the user
              does not have read permission for the tape, it is positioned
              using the tape ioctl(2) function calls.  If the seek operation
              is past the end of file, space from the current end of file to
              the specified offset is filled with blocks of NUL bytes.
Post Reply