Results 1 to 5 of 5

Thread: How to add a file to a .img file

  1. #1
    Join Date
    Mar 2010
    Location
    London, UK
    Beans
    461
    Distro
    Ubuntu Studio 18.04 Bionic Beaver

    How to add a file to a .img file

    I've been trying to install a very old version of Debian for a broadcast server (no option to go with something newer) and having a lot of problems as the main image seems to be coded to only install from /cdrom even if booted from USB originally.

    Eventually I found if I download hd-media/boot.img.gz uncompress it and dd the resultant .ing file to a usb key it boots and gets to a point where it says it's searching for the iso file, rather than specifically looking for the cdrom. Sounds promising....

    So what I wanted to do was add the debian.iso file to the boot.img image.

    What I tried (paths approx/removed)

    # mkdir /mnt/boot
    # mount -o loop if=boot.img of=/mnt/boot
    # cp debian.iso /mnt/boot
    # dd if=/dev/loop0 of=boot2.img

    md5sum of boot.img and boot2.img were the same as I assume the loop device automatically writes to the file. I wasn't sure so created the second one to check.

    After doing this it boots, I get the Spash screen but then it crashes and restarts the system.

    I have managed to get to the install stage by using two separate USB keys but I would still like to know the correct way to do the above for future reference.

  2. #2
    Join Date
    Mar 2010
    Location
    London, UK
    Beans
    461
    Distro
    Ubuntu Studio 18.04 Bionic Beaver

    Re: How to add a file to a .img file

    Nobody?? Surely adding files to a bootable disk image isn't that rare a thing to want to do and somebody much know how....

  3. #3
    Join Date
    Mar 2010
    Location
    London, UK
    Beans
    461
    Distro
    Ubuntu Studio 18.04 Bionic Beaver

    Re: How to add a file to a .img file

    One final bump in the hope of an answer......

  4. #4
    Join Date
    Oct 2006
    Beans
    58,286

    Re: How to add a file to a .img file

    Thread moved to the "Debian" forum.

  5. #5
    Join Date
    Mar 2010
    Location
    London, UK
    Beans
    461
    Distro
    Ubuntu Studio 18.04 Bionic Beaver

    Re: How to add a file to a .img file

    Quote Originally Posted by howefield View Post
    Thread moved to the "Debian" forum.
    Why when I was running Unbuntu on the computer I was trying to edit the image from. Just because the .img file in question was for Etch (debian 4.0) should make no different to the fact it's a Ubuntu (well general Linux) question....

    But seems nobody was able to answer anyway.....

Tags for this Thread

Bookmarks

Posting Permissions

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