LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   is there a Frontend/Gui for dd? (https://www.linuxquestions.org/questions/linux-software-2/is-there-a-frontend-gui-for-dd-73805/)

acid_kewpie 07-22-2003 02:32 AM

not offering to help i'm afraid... but if you don't know much QT, now's a great time to not bother learning anymore... http://gtk.org ;)

mad_ady 07-22-2003 04:45 AM

Well, I know more QT than gtk... :) But thanks for the tip. I've already started working! Wish me luck. Soon I'll post some screen shots! :)

mad_ady 07-22-2003 05:19 AM

Ok. Let's review... Here are the suggested features:

-back up boot sector
dd if=/dev/hdaX of=/file/to/write bs=512 count=1
//is this right?

-back up partition table
//no idea

-copy drive to drive
dd if=/dev/hdaX of=/dev/hdaY
//does it work if drives are not equal?

-write zeros to boot sector
dd if=/dev/zero of=/dev/hdaX bs=512 count=1

-write random 9 times to drive
{
for(i=0;i<9;i++)
dd if=/dev/random of=/dev/hdaX bs=1M
}

-create iso cdrom image
dd if=/dev/cdrom of=/iso.image

-burn cdrom image (?)
//i don't think this is necessary, because it's cdrecord's job!

-create floppy disk image
dd if=/dev/fd0 of=/file/to/write

-write floppy disk image
dd if=/file/to/write of=/dev/fd0

Now, if you spotted some errors or have suggestions about the commands, please post them! Also, if you want new features, please come up with suggestions! :)

browny_amiga, great suggestion about the disclaimer! There will be a window that pops up when the user starts informing him about how he can screw up his system!
For now, the disclaimer will be:
Code:

"xdd" is a powerful programm. It's improper use can bomb your harddisk (100%
sure non-recoverable), bomb your floppies, bomb your OS, bomb your MBR. If you
don't know what dd does or you are unsure why you are using this tool, better
don't. You might loose your data and a lot of hair with it."

acid kewpie suggested that xdd should "automatically detect partition types, device types,filesystem formats and the likes" . I have no idea how to do that! Any input is accepted! :)

"check for available space before copying" ... I think I can do that! :)

mad_ady 07-22-2003 08:05 AM

I've done some work and here's the result.. It's just the gui, it doesn't do anything yet.. Let me know if you like it and if you find it 'user friendly' (note, there will be explicit tool tips in the final version!)

Here's the link
http://www.geocities.com/mad_ady/linux/xdd.html

Notes: I'll have to change the if and of comboboxes with something that will allow the user to type in something! Any suggestions are welcome!

whansard 07-23-2003 01:20 AM

sorry that my suggestions are inside your quote,
but hopefully you'll see them.
i've been unusually busy the past week, but i'll try
to get some more suggestions soon.

you can also backup a partition (filesystem) to a file, and
compress it dd if=/dev/hdaX |gzip > filename.dd.gz
it will compress much better if you zero out the free
space first with dd if=/dev/zero of=/filename/on/mounted/
drive.zero. it doesn't really matter whether you delete
the file or not for the compression purposes

you can restore the partition (filesystem) on a partition
that is as big or bigger than the original.
dd if=filename.dd.gz | gzip -cd > dev/hdaX


Quote:

Originally posted by mad_ady
Ok. Let's review... Here are the suggested features:

-back up boot sector
dd if=/dev/hdaX of=/file/to/write bs=512 count=1
//is this right?

-back up partition table
//no idea

the partition table is in the master boot record. like
dd if=/dev/hda of=/file/to/write bs=512 count=1



-copy drive to drive
dd if=/dev/hdaX of=/dev/hdaY
//does it work if drives are not equal?
if the second drive is bigger. you mean hdX and hdY right?


-write zeros to boot sector
dd if=/dev/zero of=/dev/hdaX bs=512 count=1

-write random 9 times to drive
{
for(i=0;i<9;i++)
dd if=/dev/random of=/dev/hdaX bs=1M
}

if you write random to a filename instead, you can
cover up files you just deleted, and make recovery
unlikely. you could also use this for a test of a hard
drive to see if all of the drive is writable.
a couple of options you may with to look at are
ofbs and ifbs. thats blocksize for infile and outfile.
just bs sets both ofbs and ifbs.
besides that, i've done tests for speed, and bs=1M
was way faster than taking the default size. and when
the block sizes don't come out right even, a partial
block will be written, so it doesn't hurt anything. best
i know anyway. you could have a drop down bs=
menu, and everybody could test the speed differences.

-create iso cdrom image
dd if=/dev/cdrom of=/iso.image

-burn cdrom image (?)
//i don't think this is necessary, because it's cdrecord's job!

-create floppy disk image
dd if=/dev/fd0 of=/file/to/write

-write floppy disk image
dd if=/file/to/write of=/dev/fd0

Now, if you spotted some errors or have suggestions about the commands, please post them! Also, if you want new features, please come up with suggestions! :)

browny_amiga, great suggestion about the disclaimer! There will be a window that pops up when the user starts informing him about how he can screw up his system!
For now, the disclaimer will be:
Code:

"xdd" is a powerful programm. It's improper use can bomb your harddisk (100%
sure non-recoverable), bomb your floppies, bomb your OS, bomb your MBR. If you
don't know what dd does or you are unsure why you are using this tool, better
don't. You might loose your data and a lot of hair with it."

acid kewpie suggested that xdd should "automatically detect partition types, device types,filesystem formats and the likes" . I have no idea how to do that! Any input is accepted! :)

"check for available space before copying" ... I think I can do that! :)


acid_kewpie 07-23-2003 01:57 AM

autodetection - examine /proc/ide and such like.... simple enough.

mad_ady 07-23-2003 04:22 AM

Thanks for the suggestion, acid_kewpie.
whansard, those are good ideas, but I don't understand how that command zeros unused space... It seems to me that it zeros the whole partition!

whansard 07-23-2003 03:52 PM

Quote:

Originally posted by mad_ady
Thanks for the suggestion, acid_kewpie.
whansard, those are good ideas, but I don't understand how that command zeros unused space... It seems to me that it zeros the whole partition!



dd if=/dev/zero of=/dev/hda1 zeros first partition first drive
dd if=/dev/zero of=/dev/hda zeros first drive
dd if=/dev/zero of=filename creates a file of zeros

if you make that file on a mounted filesystem, the file
will be created up to the size of the free space on the
drive. it will not overwrite any existing files, and the
previously deleted files are fully overwritten. that way
somebody can't just use a disk editor and parse your
empty space for data. if you made a file called
mycreditcardnumber.txt, and then deleted it, the data is
still on the harddrive until overwritten. thats what the
zeroing is for. the same is true for the passwd file.
this is more useful for a fat or fat32 drive in my opinion.
let's say you've been looking at porn in windows and
you don't want somebody to be able to come in with
an undelete utility, and recover your browser cache.

mad_ady 07-24-2003 02:06 AM

I understand now... Thanks for the explanation! :) It's a good idea!

Any suggestions on saving/restoring partition table(s)?

whansard 07-24-2003 03:41 AM

the partition table is in the master boot record. like
dd if=/dev/hda of=/file/to/write bs=512 count=1

Vlad_M 07-24-2003 05:49 AM

Quote:

Originally posted by acid_kewpie
not offering to help i'm afraid... but if you don't know much QT, now's a great time to not bother learning anymore... http://gtk.org ;)
Why is GTK better than QT?

mad_ady 07-24-2003 09:50 AM

Ok guys, don't start a QT/GTK flame war over here...
whansard, thank you for that... I suppose restauration goes about the same way... I'll try them out... Naturally, not on my system, but on a vmware machine! :)

Here are the facts so far... I'd say the program is about 40% operational... Unfortunatelly I ran into some problems... I can't seem to find the itoa (integer to ascii) function that existed in ol' C... It should have been in stdlib.h, but it's not! Where can I find it, or how can I convert an integer to char or QString?

Anyway, I've started a new project on sourceforge.net. It's called dd-frontend (all the good names were taken :( ). I hope they validate my reqest by tomorrow, because I'm going away on a vacantion (I don't know for how long...) and I won't have time to deal with this...

If you can't find the dd-frontend project on sourceforge, you can download the source (in its current state) from http://www.geocities.com/mad_ady/linux/xdd.tar.gz

Anyone is free to continue my work (note, however, that I'm not giving up yet, I'm just taking a well deserved vacantion!) :)

mad_ady 07-25-2003 02:55 AM

OK, it's done. We have a project on sourceforge.net
Just go to https://sourceforge.net/projects/dd-frontend/
If you want to be a member (to code, make web page, write help), let me know (and send me your sourceforge user name).

I've uploaded the latest cvs, but it may take a while for the page to update it...

Any words of encouragement? Browny_amiga? anywone? :)

Vlad_M 07-25-2003 03:07 AM

Quote:

Originally posted by mad_ady
Ok guys, don't start a QT/GTK flame war over here...

Who is starting a flame war? I asked a question.

acid_kewpie 07-25-2003 03:45 AM

Quote:

Originally posted by Vlad_M
Why is GTK better than QT?
because *I* use it ... ;)


All times are GMT -5. The time now is 01:36 PM.