VOGONS


First post, by brostenen

User metadata
Rank l33t++
Rank
l33t++

For those that want a quick tip on how to use Linux for cloning a harddrive, then I have this easy command.
Naturally there are a lot of people here, that know this, however if you are new to Linux or dont know. Then here goes.....

First create a new folder in the Documents folder in your home folder. Like "Images" or "Backup" or something.
Then open the terminal window and write the following:

sudo dd if=/dev/sourcedrivehere conv=sync,noerror bs=128K | gzip -c > /home/myusername/Documents/imagefile.image.gz

Were sourcedrive is what devicename the source are. In my case: sdb
Were myusername is the username you have, and then add whatever path to were you want to save it.
Were imagefile is the name of the file you wish the data to be saved as.

As an example, then I used the following line:
sudo dd if=/dev/sdb conv=sync,noerror bs=128K | gzip -c > /home/Brostenen/Documents/Images/disk.image.gz

Because the USB drive is unit "sdb" on my system. It can be sdc or whatever drive you'r system have named it.
And finally. The beauty of this way, is that it takes into acount if there is any drive error's and it compresses the image file as well.

Once you run the command, then beware that it takes a looooong time when dealing with something like 120 GigaByte.
Just go make some coffee, tea or open a beer. Then go watch a cartoon or a movie..... (Or eat some food)

More explanation.... HERE

For writing the image back to a different harddrive, then the website have instructions for it as well.
I just used the disk tool that came with my Linux distribution (Ubuntu Mate), when I wrote back the image file to my Amiga CF card when testing this.

This method worked for me, cloning an Amiga harddrive. It works perfectly.....
The method is free, easy and I think it takes any filesystem, as long as you can attach the drive to the computer in some way or another.

Don't eat stuff off a 15 year old never cleaned cpu cooler.
Those cakes make you sick....

My blog: http://to9xct.blogspot.dk
My YouTube: https://www.youtube.com/user/brostenen

001100 010010 011110 100001 101101 110011

Reply 1 of 12, by lolo799

User metadata
Rank Oldbie
Rank
Oldbie

You could use a higher block size value to increase speed.
And yes, dd doesn't care about filesystems at all.
If you want a good ftp backup tool based on dd, give g4u a try http://www.feyrer.de/g4u/

PCMCIA Sound, Storage & Graphics

Reply 2 of 12, by xjas

User metadata
Rank l33t
Rank
l33t

"status=progress" is a super useful option to add to the end of the 'dd' command (exactly like that, no '-' or '--'.) It's a fairly recent addition so won't work in super old distros or Mac OSX/BSD.

For example: dd if=/dev/sdx of=image.img bs=128k status=progress
(Note that I'm not piping into gzip, so it won't compress the image.)

I usually use bs=1M or bs=4M but it doesn't make a huge difference over a certain threshold.

twitch.tv/oldskooljay - playing the obscure, forgotten & weird - most Tuesdays & Thursdays @ 6:30 PM PDT. Bonus streams elsewhen!

Reply 3 of 12, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

It makes a big difference if there are bad sectors, since a single bad sector will cause the entire block containing it to be discarded/zeroed in the image.

Reply 4 of 12, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

In that case, maybe dd-rescue is more what you want.

I had no idea about the status parameter though. I always opened another console and used "ps -a | grep dd; watch -n30 kill -USR1 <pid>"

Reply 5 of 12, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++
SirNickity wrote on 2020-02-14, 22:43:

In that case, maybe dd-rescue is more what you want.

I had no idea about the status parameter though. I always opened another console and used "ps -a | grep dd; watch -n30 kill -USR1 <pid>"

I really miss status=progress when I'm running Solaris or BSD.

All hail the Great Capacitor Brand Finder

Reply 6 of 12, by brostenen

User metadata
Rank l33t++
Rank
l33t++
jmarsh wrote on 2020-02-14, 20:26:

It makes a big difference if there are bad sectors, since a single bad sector will cause the entire block containing it to be discarded/zeroed in the image.

If there is bad sectors, you will have a hard time reading the data anyway. Like they say... Real men do no backup's, they cry instead.

Morale of the story... Just do backup anyway. I look at DD as a tool for cloning a fresh install. The option to keep copying if there is bad sectors, are only used, because it will be a waste of time if you get to like 95/98 percent cloning of a one terrabyte drive.

Don't eat stuff off a 15 year old never cleaned cpu cooler.
Those cakes make you sick....

My blog: http://to9xct.blogspot.dk
My YouTube: https://www.youtube.com/user/brostenen

001100 010010 011110 100001 101101 110011

Reply 7 of 12, by clueless1

User metadata
Rank l33t
Rank
l33t

SpinRite is a good tool for fixing bad sectors, especially on old/retro drives. It is not freeware, it costs $90, but once you buy it, you can use it on however many drives you want for the rest of your life. It is a DOS utility and must be run from native DOS, but it is very good at finding and fixing bad sectors if the drive is not already near-death. I've used it to make a dying drive readable "one last time" to get the data off. It is also a good maintenance tool. Run it on Level 4 once a year or so on your old drives to revive weak sectors and keep them from going bad.

The more I learn, the more I realize how much I don't know.
OPL3 FM vs. Roland MT-32 vs. General MIDI DOS Game Comparison
Let's benchmark our systems with cache disabled
DOS PCI Graphics Card Benchmarks

Reply 8 of 12, by brownk

User metadata
Rank Member
Rank
Member

Once you're in the realm of terabytes, try 'cat' instead.

Reply 9 of 12, by Zup

User metadata
Rank Oldbie
Rank
Oldbie

I'd use clonezilla to do disk imaging if your computer supports it (and I'd try older versions if modern ones are not supported). Clonezilla will try to copy only data used in filesystems (using less space), have more compression options (again, less space) and it can resize the filesystems if you need to restore your image in bigger disks (I haven't had any success trying to restore into smaller disks even if actual data fit into them). Keep in mind that some filesystems store information about the physical disk layout and can not be directly used on disks with other layouts.

The only real advantages of dd are that works in any Unix ( but will stall or crash if it founds data errors) and that you can mount your image and extract files (but that advantage can be lost using gzip, I don't know if compressed images can be mounted directly). If your disk is not healthy, I'd use dd-rescue without gzip to copy it (and then, you can use ddrutils to check what files were related to bad blocks). Also, if you're using Linux, I'd try to use bzip2 instead of gzip to compress your image and save some space.

I have traveled across the universe and through the years to find Her.
Sometimes going all the way is just a start...

I'm selling some stuff!

Reply 10 of 12, by pewpewpew

User metadata
Rank Oldbie
Rank
Oldbie

Just to group like-with-like,

1] These days, typical linux desktops also let you img easily from the GUI. Attached below is a capture from gnome-disks-utility. (Shown in Mint, which is derived from Ubuntu, which is derived from Debian...)

2] For SATA drives I have this Inatech USB3.0 dock / cloning -station. It's been absolutely great. Deserves all the 5-stars people give it. I mostly use it to do badblocks and grsync backups via USB3.0 on a retired laptop. Buti it's also a stand-alone cloning station. Which is great for my gameboxes, and also for making offsite copies of my main backup.

It doesn't do anything I wasn't already doing with semi-retired 'utility' computers. But it does take up less space, and it works very well. I'm glad I picked one up.

Reply 11 of 12, by clueless1

User metadata
Rank l33t
Rank
l33t
Zup wrote on 2020-02-16, 18:21:

I'd use clonezilla to do disk imaging if your computer supports it (and I'd try older versions if modern ones are not supported).

For Win9x, you need Clonezilla 1.1.0-8 and Gparted 0.3.7-7. See Re: Utility for making exact hard drive clones?

The more I learn, the more I realize how much I don't know.
OPL3 FM vs. Roland MT-32 vs. General MIDI DOS Game Comparison
Let's benchmark our systems with cache disabled
DOS PCI Graphics Card Benchmarks

Reply 12 of 12, by VileR

User metadata
Rank l33t
Rank
l33t

Not strictly "Linux only" -- I've used dd for Windows to clone/image hard drives and CF cards.

It's a little tricky to come up with the correct device name to get the most complete image possible (e.g. MBR and partitions). You gotta run "dd.exe --list" as administrator and do a bit of trial-and-error with the different "\\?\Device\" names for your disk.

However, Clonezilla is indeed a more comprehensive tool and I can endorse it as well.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]