Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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!)
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
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!
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!
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
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.
Distribution: Red Hat 8.0 (Home), Red Hat 8.0 (Work)
Posts: 388
Rep:
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
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...
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.