Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, I have a rootfs image in .img format. Now I want to load this image to sd card. How can I do it? Should I just copy it to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    25

    Loading rootfs image to sdcard


    Hello,

    I have a rootfs image in .img format. Now I want to load this image to sd card. How can I do it?

    Should I just copy it to the sdcard by using cp command or by using dd?

    Also is there a way to mount the .img file over the host system?

  2. #2
    Linux User
    Join Date
    Dec 2011
    Location
    Turtle Island West
    Posts
    280
    cp won't do it. dd if=rootfs.img of=/dev/sdX would be the way, but make very sure you pick the correct dev/sdX, or you'll shoot yourself in the foot.

    That is, of course, assuming it's actually a bootable image and not a initrd type of thing.

  3. #3
    Just Joined!
    Join Date
    Feb 2010
    Posts
    25
    Do I have to partition the sdX device first or dd will partition the device automatically?

  4. #4
    Linux User
    Join Date
    Dec 2011
    Location
    Turtle Island West
    Posts
    280
    dd doesn't anything except low level read/writes. It make exact duplicates of data. If you use dd, it mercilessly over-writes whatever was there to begin with.

    I'd copy anything important of the stick so you can clobber it without remorse, dd the img on to it, and see if it boots.

    I tried copying a bootable cd onto a USB stick the other day with dd, and it didn't boot. I could mount it as iso9660 and access the files, but the boot process wasn't amused.

    The only way to find out is to try.

Posting Permissions

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