Find the answer to your Linux question:
Results 1 to 7 of 7
I have seen many tutorials on how to do this in windows using downloadable programs, but I have no idea how to do this in Ubuntu. I assume it is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2011
    Posts
    2

    Question Writing a bootsector.bin file to a USB sector 1


    I have seen many tutorials on how to do this in windows using downloadable programs, but I have no idea how to do this in Ubuntu. I assume it is the same in ever other variant of Linux but I just wanted to note that I am using Ubuntu 10.04LTS.

    My main purpose for this is to write the 8086emu Micro-OS-Loader (Cylinder 0, head 0, Sector 1) and Micro-OS-Kernel (Cylinder 0, head 0, Sector 2) to a USB flash disk to test to see if it boots up or not. I could do this in Windows, but I want to know how to do this in Linux so I am not dependent on using Windows in order to write my Operating system's data on my USB.

    If you need additional information on the system I am using, just ask and I will edit the first post.

    Thank you for your help.

  2. #2
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    The flash disk should show up as a /dev device, probably /dev/sdb or whatever letter is next after what's already there before you connect it. You'd use dd to write the sectors. Look at "man dd" and see the "if", "of", "bs", "count", "seek", and "skip" options. You sound clueful enough to work it out from there.

  3. #3
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    581
    Code:
    dd bs=512 count=1 if=YOURSOURCEFILENAMEGOSHERE of=/dev/sdX
    where "/dev/asX" is the correct device for your USB device.

  4. #4
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    Quote Originally Posted by alf55 View Post
    Code:
    dd bs=512 count=1 if=YOURSOURCEFILENAMEGOSHERE of=/dev/sdX
    where "/dev/asX" is the correct device for your USB device.
    If the other assumptions in that are correct, I think Kammce will want count=2.

  5. #5
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    581
    Yes, the count would be "2", if you "sector" really was "block" or that the loader is 1024 bytes long.

  6. #6
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    The OP specifically says he needs two sectors, 1 and 2.

  7. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,159
    Whether count=1 or count=2 depends upon whether or not the input data is in one file or two. If one file, then this should work
    Code:
    dd bs=512 count=2 if=filename of=/dev/sdX
    if two files, then this should work:
    Code:
    dd bs=512 count=1 if=filename1 of=/dev/sdX
    dd bs=512 count=1 if=filename2 of=/dev/sdX seek=1
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •