Disk Image Creator

Miscellaneous tools
Post Reply
Message
Author
mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

Disk Image Creator

#1 Post by mistfire »

This is a simple disk image creator. It can be format to vfat, ntfs, ext2, ext3, and ext4
Attachments
disk-creator-gui.JPG
(22.8 KiB) Downloaded 678 times
image-file-creator-1.0.pet
(1.35 KiB) Downloaded 358 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hi mistfire.

Nice coding.

But what is the benefit of having an "img" file as compared to a "sfs" file
or regular zip or tar.gz files?

I know that "img" files are used by Macs. But what else?

Thanks in advance.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#3 Post by mistfire »

image file creates a writable disk image. compared to sfs which is read-only. I used writable ext3 image as a working space for modifying linux files which requires linux partition. Which means you can modify or put some files on it while the image file is mounted like pupsave

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#4 Post by musher0 »

Hello mistfire.

I didn't know that. Interesting. Thank you for the information.

Have a great day!
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#5 Post by backi »

Hi !
Yes indeed .......interesting .....

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

Hello again, mistfire and baki.

You are giving me ideas... ;)

Am I right to suppose that
-- you can have / modify any part of the Linux hierarchy of directories in a
mounted img file?

If so, that would be great for building / remastering / prototyping a Puppy in
real time.

Assuming that, once you have finished, you can write back this img file to
some directory and create an sfs file from that dir,
OR
convert this img file directly to an adrv_xyz.sfs, for example?

Can this be done? TIA.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#7 Post by slavvo67 »

Works nice and quickly. It would be nice if you added a mount utility so make this a one-stop shop.

Also, I had to change line 51 and line 55 for quirky to:

51. yad --text="Success!" info "$IMGPATH has been created"

55. yad --text="Error!" error "$errmsg"

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#8 Post by mistfire »

@musher0 mounted img file is very usable on remastering puppy with this scenario:

* Remastering puppy by extracting and editing the contents of sfs file but you have no ext partition and you have a limited space on your save file. By creating ext img file on the mounted vfat or ntfs partition and mounting the img file, you can now extract the sfs file and modify it.

* You cannot convert disk image file to sfs file. Just mount the image file and issue mksquashfs command to the directory where the disk image is mounted

@slavvo image mounting can be done using filemnt

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post by musher0 »

@mistfire:

Do you mean that an img file cannot be mounted on an ext2, 3 or 4
partition? Am I understanding this correctly?

TIA.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#10 Post by nic007 »

In the past I used a fake savefile to do remasters on a FAT partition. I created a "permanent" savefile of about 1GB which would then be mounted whenever a linux workspace was required. What benefits would there be using an img file instead?

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#11 Post by mistfire »

@musher0 img file can mount on ext partition. Its your style, choice, and move how to use img that file.

Also using tool can be make disk image file for qemu virtual machine.

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#12 Post by mistfire »

nic007 wrote:In the past I used a fake savefile to do remasters on a FAT partition. I created a "permanent" savefile of about 1GB which would then be mounted whenever a linux workspace was required. What benefits would there be using an img file instead?
I noticed that 2fs, 4fs, 3fs, and img are the same disk image. This tools will make a disk image and use it right away after its created.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#13 Post by slavvo67 »

I'm sorry but I'm a little confused. I know the img file is written in the root directory but how are you pointing to what the .img file should contain? Is it an .img of your current running system or do you need to run the program out of the directory where you want an .img to be created? If it's just creating a blank .img file, then we need to mount it and add things.

I read that mounting it is a bit more challenging as you need to determine the start and ending block.... Don't we have a pup utility that takes care of this?

Anyway, I find this nice and fast but I don't know how to use the final .img :lol:

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#14 Post by mistfire »

@slavvo67 disk image creator creates an empty formatted image file. It depends on you what contents do you want to put in the image file.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#15 Post by slavvo67 »

Okay, it looks like I'm answering my own questions.

The below mounts if it's fat or change msdos to ext2, 3, 4.
rw is for read/write
image.img is the image file name

/mnt/sdc1 is where you are mounting to or any /mnt/sd....

mount -t msdos -o loop,rw image.img /mnt/sdc1

Of course, need to unmount when done:

umount /mnt/sdc1

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#16 Post by slavvo67 »

A couple more comments and questions, if I may:

Let's say I create an .img file, mount it and fill it with .mp3 files. If burned to a cd, will it play like a regular music cd? I know there are utilities for this ----> Just curiousity...

Is there a way to password protect the .img file. Interesting locker idea....

Lastly, just a comment that the gui stays opened after creating an image. You may want to have it close or place a quit or exit button to exit the program.

Best,

Slavvo67

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#17 Post by slavvo67 »

Sorry, mistfire -- I hope you don't think I'm taking over your thread. Just find this interesting so I'm doing light enhancing.


I threw in the cancel button, highlighted below.


<hbox>
<text><label>Create Image</label></text>
<button>
$(/usr/lib/gtkdialog/xml_button-icon execute)
<action>make_img</action>
</button>
<button cancel></button>
</hbox>

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#18 Post by mistfire »

slavvo67 wrote:A couple more comments and questions, if I may:

Let's say I create an .img file, mount it and fill it with .mp3 files. If burned to a cd, will it play like a regular music cd? I know there are utilities for this ----> Just curiousity...
I think it will not work because audio cd is a different thing since audio cd has no filesystem at all. Its just raw binary data
slavvo67 wrote: Is there a way to password protect the .img file. Interesting locker idea....
I think losetup command can do the trick
slavvo67 wrote: Lastly, just a comment that the gui stays opened after creating an image. You may want to have it close or place a quit or exit button to exit the program.

It will stays open unless you click the close button

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#19 Post by Argolance »

Hello mistfire,
Thanks.
I thought you might be interested in this :arrow: message.

Cordialement.

Post Reply