how to edit or expand an *.img file - Slackware

This is a discussion on how to edit or expand an *.img file - Slackware ; i get the img file like this, dd if=/dev/sdb of=xxx.img the file is like this: file xxx.img x86 boot sector fdisk -l ./xxx.img Disk ./c.img: 0 MB, 0 bytes 16 heads, 63 sectors/track, 0 cylinders Units = cylinders of 1008 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: how to edit or expand an *.img file

  1. how to edit or expand an *.img file

    i get the img file like this, dd if=/dev/sdb of=xxx.img
    the file is like this:

    file xxx.img
    x86 boot sector

    fdisk -l ./xxx.img
    Disk ./c.img: 0 MB, 0 bytes
    16 heads, 63 sectors/track, 0 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    Disk identifier: 0x00000000
    Device Boot Start End Blocks Id System
    ../xxx.img1 * 1 203 102280+ e W95 FAT16
    (LBA)


    now , i wana to read the file in first partation , how will i do?

    by the way , could somebody tell me the couse of /dev/sdb to /dev/
    sdb1 /dev/sdb2...
    thank you

  2. Re: how to edit or expand an *.img file

    On Wed, 26 Dec 2007 23:44:26 -0800, Bruce !C!+ wrote:

    > i get the img file like this, dd if=/dev/sdb of=xxx.img the file is like
    > this:
    >
    > file xxx.img
    > x86 boot sector
    >
    > fdisk -l ./xxx.img
    > Disk ./c.img: 0 MB, 0 bytes
    > 16 heads, 63 sectors/track, 0 cylinders Units = cylinders of 1008 * 512
    > = 516096 bytes Disk identifier: 0x00000000
    > Device Boot Start End Blocks Id System
    > ./xxx.img1 * 1 203 102280+ e W95 FAT16 (LBA)
    >
    >
    > now , i wana to read the file in first partation , how will i do?
    >
    > by the way , could somebody tell me the couse of /dev/sdb to /dev/ sdb1
    > /dev/sdb2...
    > thank you


    Hi,
    I think that you can mount it via the loop device.
    Take a look at Slackware manpage for mount.
    Near the bottom is a paragraph entitled "THE LOOP DEVICE"
    Good luck

  3. Re: how to edit or expand an *.img file

    Bruce !C!+ wrote:

    > i get the img file like this, dd if=/dev/sdb of=xxx.img
    > the file is like this:
    >
    > file xxx.img
    > x86 boot sector
    >
    > fdisk -l ./xxx.img
    > Disk ./c.img: 0 MB, 0 bytes
    > 16 heads, 63 sectors/track, 0 cylinders
    > Units = cylinders of 1008 * 512 = 516096 bytes
    > Disk identifier: 0x00000000
    > Device Boot Start End Blocks Id System
    > ./xxx.img1 * 1 203 102280+ e W95 FAT16
    > (LBA)
    >
    >
    > now , i wana to read the file in first partation , how will i do?


    I saw this on some website talking about KVM I hope that it helps.

    One reason to use the Raw disk image format (the default) is that it can
    then be mounted with the command:

    mount -o loop,offset=32256 your-disk-images-name.img /mnt

    This allows you to easily copy files from your system into (and out of) the
    disk image (the offset is so that the boot sector of the image is not
    mounted).

    Using the raw disk image format does not result in larger files than the
    other formats (except cloop which is a compressed format) as the reserved
    space is simply recored as "next follows a string of x million zeros"
    rather than actually writing x million zeros. This is true for Reiserfs,
    ext2, ext3 and other Linux filesystems, but apparently not true for
    Windows.

    > by the way , could somebody tell me the couse of /dev/sdb to /dev/
    > sdb1 /dev/sdb2...
    > thank you

    You will need to read the partition table of sdb to find the locations of
    partition 1 etc. You should google for some information like "partition
    tables" gives a few links. This is a complicated subject, not easily
    explained.
    http://en.wikipedia.org/wiki/Disk_partitioning
    http://mirror.href.com/thestarman/as...PartTables.htm
    http://ata-atapi.com/hiwtab.htm

    Also the lilo documentation has some information on this.

    Richard James

+ Reply to Thread