Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Ask Slashdot: Create Custom Recovery Partitions With FOSS?

timothy posted about 3 years ago | from the moving-the-bits-around-again-and-again dept.

Businesses 133

First time accepted submitter KowboyKrash writes "OK, a little background: I use Acronis to create custom recovery partitions for my personal computers that include all my software and drivers. I also work for a growing computer repair shop which has ventured into eBay sales of refurbished computers. We receive the machines with wiped hard drives. Since we get multiples of each model, we load everything on one then make images with Clonezilla. It would be nice to set up recovery partitions as well. Acronis is out of the question, since it would cost for a license for each machine. Do any Slashdotters know of any FOSS options?"

cancel ×

133 comments

Sorry! There are no comments related to the filter you selected.

dd (2, Funny)

Hatta (162192) | about 3 years ago | (#37653908)

dd

Re:dd (-1)

Anonymous Coward | about 3 years ago | (#37653914)

dd

What does yo mamma's titties have to do wit it?

Incomplete answer (0)

Anonymous Coward | about 3 years ago | (#37653948)

And grub

No, ntfsclone is what you're looking for. (2)

yakovlev (210738) | about 3 years ago | (#37654280)

I do this on my machines at home. Use ntfsclone and gzip to create compressed image files on a bootable linux partition. You can then create some custom scripts to ask for permission then restore the image automatically.

Re:No, ntfsclone is what you're looking for. (1)

m6ack (922653) | about 3 years ago | (#37654454)

I do this on my machines at home. Use ntfsclone and gzip to create compressed image files on a bootable linux partition. You can then create some custom scripts to ask for permission then restore the image automatically.

Assuming that all machines are using NTFS...

Re:No, ntfsclone is what you're looking for. (2)

realityimpaired (1668397) | about 3 years ago | (#37655054)

The GGP suggested dd, which doesn't really care whether it's ntfs or not. dd piped with gzip to compress the image, and you should be able to easily create images of just about any filesystem out there. If you don't care about storage space (or it's a small OS partition with user files on a separate partition), you can also forgo piping in gzip.

Re:No, ntfsclone is what you're looking for. (1)

zoloto (586738) | about 3 years ago | (#37658190)

Or stick it on a read-only compact flash card. Boot with grub into windows (2 second countdown) or interrupt it and boot the recovery partition. Sounds like a winning combo!

Re:No, ntfsclone is what you're looking for. (3, Informative)

zougloub (1166719) | about 3 years ago | (#37655442)

For NTFS partitions, ntfsclone --save-image / --restore-image is really efficient. You probably want to feed its output to lzop instead of gzip, because gzip/bzip2/xz would be a bottleneck and you don't gain that much with it: - compressing is longer - decompressing is longer - space gain is not magical (when performing an initial disk image (whole disk, with dd/cat) of an OEM laptop with a 640GB disk, I had 26GB with xz --extreme instead of 44GB with lzop -3). xz file was too slow to decompress, so I finally deleted it. Note: if the MBR or partition boot is broken, you'll need to boot with a Windoze rescue CD to fix that.

Re:No, ntfsclone is what you're looking for. (3, Interesting)

Ayourk (1125735) | about 3 years ago | (#37656020)

For the MBR being broken, why not just take a dd image of that section of the HDD and present that as an option as part of the repair process? Having backups of the MBR, partition table and FAT are good ideas for recovery options IMHO.

Re:No, ntfsclone is what you're looking for. (1)

CSMoran (1577071) | about 3 years ago | (#37656364)

I agree on backing up the MBR but what good would restoring FAT and not the files do?

Re:dd (1)

Joce640k (829181) | about 3 years ago | (#37654306)

On a related note, is there anything which can replace Acronis, period. Acronis jumped the shark years ago...

Here's the scenario.

a) Client buys a USB hard disk.
b) Client installs some software on their machine and configures it, marking the USB disk as a 'backup disk' in some way.
c) Every time the client connects the USB disk to their computer a window pops up saying: "Backup your machine? Y/N"
d) If they click "yes" the software backs up their machine, administering disk space, etc. automatically.

To me it seems the most obvious need for backup software imaginable but neither Norton nor Acronis seem to be able to get their head around the concept of removable backup disks or not wanting to answer twenty questions every time you want to make a backup. Or a dozen other things that make me shake my head sadly whenever I have to use them. Don't even get me started on what happens when Windows randomly decides to change the drive letter for the USB drive.

Target users use Windows XP and 7. They're office users who use Office and accounting software. They typically only have about 40Gb of files to back up so they're quite happy with non-incremental backups. I live in Spain so Spanish versions are a big plus (though not essential).

Any ideas? There must be something out there...

Re:dd (1)

beelsebob (529313) | about 3 years ago | (#37654432)

Time Machine – plug USB disk in, incremental backup occurs, done.

Re:dd (1)

Anonymous Coward | about 3 years ago | (#37654536)

Ok, so not *exactly* what you are looking for (its not fully automatic) but I have found a similar problem and my best solution so far:

1) Install Toucan on the removable drive - http://portableapps.com/apps/utilities/toucan

2) Create a destop icon for Toucan - it will only be capable of running when the drive is plugged in

3) Create the backup job and save it in Toucan ready for running the next time. All Toucan's data is stored locally, on the removable drive

4) Tell the customer all he has to do is plug in the USB drive, double click the icon, select the backup job from a drop-down a click 'Run'.

I still think there is a need for what you describe above but for manual backups on USB disks this is working for me right now. It won't when Windows changes the USB disk letter for no reason though ;-). One last thing, I'm not sure Toucan has a Spanish option.

Re:dd (0)

Anonymous Coward | about 3 years ago | (#37654542)

Use the free personal edition of Macrium reflect. I do the same process every sunday.

Re:dd (1)

MikeB0Lton (962403) | about 3 years ago | (#37654928)

Symantec makes Backup Exec System Recovery for this scenario. Unfortunately it is sold in bulk amounts and is for the enterprise. It needs a basic configuration and then can automatically recognize when a USB hard drive in the set is attached and just back up. It can keep a local copy and also ship a copy to a CIFS share if that is your thing.

Re:dd (0)

Anonymous Coward | about 3 years ago | (#37655436)

Clonezilla

Re:dd (1)

whoisisis (1225718) | about 3 years ago | (#37654406)

Assuming each machine have the same hard drive size, dd is probably the easiest way to go.
You could even do it very quickly if you started with a zeroed out drive, install everything and then compress
it to a drive image. Then just nc <server-ip> <port-number> | tar -zx | dd of=/dev/sda
from a live CD/USB disk

Re:dd (0)

Anonymous Coward | about 3 years ago | (#37656708)

Then just nc <server-ip> <port-number> | tar -zx | dd of=/dev/sda
from a live CD/USB disk

"tar -zx"? You mean "gzip -cd", "bzip2 -cd" or another (de)compressor, not an archiver.

Re:dd (0)

Anonymous Coward | about 3 years ago | (#37654890)

the OP did not ask for a snarky, geek solution. He ask for an end-user solution. Take your snarkyness somewhere else

Re:dd (1)

optimism (2183618) | about 3 years ago | (#37658002)

Why is the "dd" suggestion modded as "funny", when it is perhaps the most flexible/practical response to the question?

Personally I use PING (PartImage Is Not Ghost) on my Windows machines, because it knows to ignore stuff like the multi-gigabyte Windows paging and hibernation files. But to each their own.

To the OP: If an ebay buyer is smart enough to find and use a recovery partition, they are probably smart enough to NOT want to use someone else's recovery partition. Be sure to provide the factory install discs (and for Windows, the COA with product key) for every machine if you want to sell them to anyone with half a clue.

Re:dd (1)

rwa2 (4391) | about 3 years ago | (#37658132)

Looks pretty cool... I've used partimage lots for Linux machines, but it certainly is not ideal (needs better support for resizing on the fly, and stuff like that).

The last time I needed something to clone Windows machines, I DID have pretty good results remastering a knoppix LiveCD that could run Ghost within FreeDOS. It had most of the benefits of PING (such as being able to backup and restore to a network share, which was the main reason I created it). The main limitation was that I still needed to use dd if=/dev/sda of=mbr.dd.img bs=512k count=1 to backup and restore the MBR/partition table, since the FreeDOS of the time didn't allow wholedisk access. But aside from that it was very fast and worked well.

I used lredir withing FreeDOS to map the network share to a drive letter within FreeDOS. I didn't have much luck trying to get Ghost to read/write directly to a shared partition, e.g. a locally connected USB drive.

Of course, this doesn't exactly help the OP, unless they have a bunch of Norton Ghost licenses lying around for some reason :-P But I would advocate simply distributing a rescue DVD that boots off a linux-based LiveCD as opposed to a rescue partition.

partimage? (2)

vlm (69642) | about 3 years ago | (#37653938)

partimage

http://www.partimage.org/Main_Page [partimage.org]

I haven't used it since probably 2005 or so, but it used to work quite well over the network.

Re:partimage? (1)

SignOfZeta (907092) | about 3 years ago | (#37654242)

Sounds like a great idea, but it seems like NTFS support is still experimental. Has anyone tried this?

Re:partimage? (1)

davester666 (731373) | about 3 years ago | (#37654950)

No. Everybody is waiting until it reaches v0.1

Re:partimage? (1)

jhary-a-conel (1101325) | about 3 years ago | (#37655516)

NTFS support worked well enough for me to use it to clone/restore windows 2003 server. (Master install, sysprep and add drivers, partimage to clone it then to restore on to other systems.) It always worked very well. A great little tool.

Re:partimage? (1)

RoscBottle (937276) | about 3 years ago | (#37656432)

Yep. No problems at all, but then I don't think the partition had any encrypted streams to cope with. Windows 7.

Re:partimage? (0)

Anonymous Coward | about 3 years ago | (#37656470)

Whenever I buy a bunch of identical machines for work, I install Windows on one, setup all the apps they need, then clone the first install over to the rest using partimage, so I've used it on NTFS machines a great deal, never with any problems, going back at least 5 years.

Re:partimage? (1)

Alan Evans (875505) | about 3 years ago | (#37658110)

I have not used partimage in a long time either but I had great results when I did. I imaged a couple hundred WindowsXP boxes without problems. The biggest thing I ran into was having to set the sector offset in the bootloader when a partition moved from one place on a box to another. Another that I had a lot of luck with though not as 'pretty' as partimage is ntfsclone which is part of ntfsprogs. -Alan

Re:partimage? (1)

pnutjam (523990) | about 3 years ago | (#37658632)

I've been using fsarchiver, http://www.fsarchiver.org./ [www.fsarchiver.org] It lists NTFS as experimental, but I've never had a problem. It will restore to smaller or larger disks. You will need to fix the mbr if you change disk size, but for an on HD script that should not be a problem. Interfaces is very scriptable.

Gparted (1)

sakdoctor (1087155) | about 3 years ago | (#37653942)

Gparted on a live CD.

Re:Gparted (1)

tiddlydum (1943210) | about 3 years ago | (#37654484)

Gparted is a partition editor, not an OS recovery tool, as the OP is requesting. OP is asking for a recovery partition tool, which would install a set of OS recovery/resetting tools into a small partition at the start of the drive.

Re:Gparted (0)

Anonymous Coward | about 3 years ago | (#37654852)

"OP is asking for a recovery partition tool, which would install a set of OS recovery/resetting tools into a small partition at the start of the drive."

Correct. Which is a highly bizarre thing to ask, being that for oh, maybe 30 or 40 years now, dd has existed and worked fine.

Seriously, what's next? A slashdot article to ask how we can list the files in a directory? Or sort lines in a file?

People need to realize that computers have been around a long time, and if they're on the younger side, solutions to these problems were invented by their GRANDPARENTS.

testdisk (0)

Anonymous Coward | about 3 years ago | (#37653968)

testdisk by christophe grenier

Here's an idea (2)

LiroXIV (2362610) | about 3 years ago | (#37653970)

1. Rig a minimal Linux installation on another partition. 2. Make it auto-login and launch a bash script which will: a. Give you a warning message b. Launch Clonezilla automatically, somehow pre-configured to re-image in the right place

Re:Here's an idea (3, Informative)

FalleStar (847778) | about 3 years ago | (#37654066)

No need to launch CloneZilla, all the bash script would have to do is:

  1. Get confirmation from the user to perform the restore
  2. dd if=/path/to/backup.img of=/dev/sda1(or whichever is the main partition)
  3. Reboot

Re:Here's an idea (0)

Anonymous Coward | about 3 years ago | (#37654338)

Launch Clonezilla automatically, somehow pre-configured to re-image in the right place

Now THERE'S the level of technical expertise that one has come to expect from Slashdot these days, especially from those with high UIDs.

Double down on clonezilla... (2)

bwcbwc (601780) | about 3 years ago | (#37654008)

If you are doing windows boxes and you are already paying for new Windows OEM / System Builder licenses, I'm pretty sure it's legal for you to use WinPE or a similar tool to install a recovery partition. If you're using pre-existing Windows licenses on the boxes, it might still be legal.

But the easiest option may be to ship the clonezilla image you are already using with a bootable clonezilla partition. Basically instead of installing clonezilla to a flash drive or a DVD, put it on the recovery partition. Put some scripting in the clonezilla partition to configure the clonezilla settings so that it is setup to restore the image to the main OS partition as the default action. This would work for Windows or Linux.

Re:Double down on clonezilla... (1)

pnutjam (523990) | about 3 years ago | (#37658640)

Sorry to be a Debbie Downer...

Per the most recent release of MS's reimageing rights, you must be an OEM, or Volume License holder to perform any cloning or imaging. I read this to say you must own at least ONE volume license. Whether that is the machine you are cloning or not.

FOG Project (2, Informative)

Kr1ll1n (579971) | about 3 years ago | (#37654016)

Works off of PXE boot....
http://www.fogproject.org/ [fogproject.org]

Re:FOG Project (2)

Kr1ll1n (579971) | about 3 years ago | (#37654056)

Build 1st box with recovery (OS+RECOVERY), FOG and go, was my point.

Re:FOG Project (0)

Anonymous Coward | about 3 years ago | (#37654122)

The question was how to build a recovery partition, not how to replicate the machines with a recovery partition already on it. I'd say the mod was spot-on. Off-topic.

Re:FOG Project (1)

Kr1ll1n (579971) | about 3 years ago | (#37658256)

First time accepted submitter KowboyKrash writes
"OK, a little background: I use Acronis to create custom recovery partitions for my personal computers that include all my software and drivers.............."

I'd say I was spot on with my response....He obviously knows HOW to build recovery partitions already, and is concerned about licensing issues with products such as Acronis.

Re:FOG Project (1)

mrmeval (662166) | about 3 years ago | (#37654444)

A 'minor bug' that demands they rip that version off their server and that users don't use it. http://www.fogproject.org/?q=content/minor-bug-031 [fogproject.org]

Re:FOG Project (1)

flydpnkrtn (114575) | about 3 years ago | (#37656550)

Right. For the database schema update after you upgrade FOG, when you use the web interface you don't get redirected to the 'schema update' page. Minor bug, that would require an admin to run mysql and pipe in the database schema update script. Not really that big of a deal...

What's your point exactly?

Recovery partition is moot (1)

Anonymous Coward | about 3 years ago | (#37654050)

I've never really understood the purpose of a recovery partition as a means of restoring a system. If a disk fails, a common reason for wanting to restore the PC, then that partition becomes useless. It's much better to just include disks so that a user can restore the PC them selves after the new hard drive is in place. Having said that, I have done something similar while making an extra buck in college with ebay sales.

I would create a small partition (~2 GB) that held two CD images (.iso's). One was the XP install cd (with legal COA on the shell), the other was a disk containing the latest stable drivers for all the hardware, and any pre-installed software that I bundled with the PC, things like OpenOffice, imgburn, ect. that would get them back to the state in which they received the PC. What I then did was create a guide (hard copy) that instructed them how to step by step burn these images to cd's and store them in a safe place as soon as possible. I doubt any of them did, but it's there for them if they want it.

Either way, included DVD's or CD's are the best method. The average user probably would have a family member who knew what they were doing restore the system anyway, or bring it in to a shop that would do it for them. You have to ask what the return on this time investment is going to be too. Will this feature increase sales? will it make them more likely to come back for a repair? (hopefully they won't need it). Probably no, but that's up for you to decide.

Re:Recovery partition is moot (0)

Anonymous Coward | about 3 years ago | (#37654108)

I am given to understand that the recovery partition is there so that the user can make a reformat/repair CD/DVD while the computer still works. At least, that is the explicit function of the recovery partition on my Asus laptop.

Re:Recovery partition is moot (2)

poity (465672) | about 3 years ago | (#37654130)

Software fuckup is more common than disk failure. That's why recovery partitions are convenient. They also minimize support costs.

Re:Recovery partition is moot (1)

Joe_Dragon (2206452) | about 3 years ago | (#37654142)

you can build the XP iso with driverpacks http://driverpacks.net/ [driverpacks.net] . So most dirvers auto install and they you may still need a few drivers + the full ATI / Nvidia / intel drivers.

Also you can build XP with http://driverpacks.net/ [driverpacks.net] and still be able to do repair installs. The big thing with drivers packs is adding the SATA / other controller drivers so the installer can see the HDD's.

Re:Recovery partition is moot (1)

silanea (1241518) | about 3 years ago | (#37654282)

[...] the other was a disk containing the latest stable drivers for all the hardware, and any pre-installed software that I bundled with the PC, things like OpenOffice, imgburn, ect. [...]

Am I the only one who cringes at reading this? If you are dealing with someone who needs a recovery disk in the first place, do you really want them to deploy hopelessly outdated drivers and software on their machines?

Re:Recovery partition is moot (1)

Gaygirlie (1657131) | about 3 years ago | (#37654388)

Am I the only one who cringes at reading this? If you are dealing with someone who needs a recovery disk in the first place, do you really want them to deploy hopelessly outdated drivers and software on their machines?

It's still better than nothing, you know. Once the restore has run it's easy enough to let it download the updates.

Re:Recovery partition is moot (0)

Anonymous Coward | about 3 years ago | (#37656130)

All 2.5GB of it.

Re:Recovery partition is moot (1)

swalve (1980968) | about 3 years ago | (#37655052)

They are the drivers and software that worked when the computer was new, so it would work just fine.

Re:Recovery partition is moot (1)

vtcodger (957785) | about 3 years ago | (#37655922)

**Am I the only one who cringes at reading this?**

I kind of hope so

**If you are dealing with someone who needs a recovery disk in the first place, do you really want them to deploy hopelessly outdated drivers and software on their machines?**

Well, I would. At least the old stuff used to work on that PC. You apparently would like them to magically acquire improved drivers and software that quite possibly won't work on their configuration. How are they going to get that sterling new software BTW? Their PC presumably isn't working all that well or they probably wouldn't be trying to reinstall their OS.

Re:Recovery partition is moot (1)

Ayourk (1125735) | about 3 years ago | (#37656072)

Am I the only one who cringes at reading this? If you are dealing with someone who needs a recovery disk in the first place, do you really want them to deploy hopelessly outdated drivers and software on their machines?

For older machines, most of the time there is no such thing as newer drivers, so (depending on the age of the hardware) having "outdated" drivers is all there will ever be.

Re:Recovery partition is moot (0)

Anonymous Coward | about 3 years ago | (#37654304)

Discs? Ew, get with the times.
Memory stick or nothing, they are extremely cheap now.
If it is PC, you could even go as far as making a compartment for it inside the case so it absolutely cannot get lost unless the idiot user removed it and never placed it back in. There is plenty of space at the bottom of almost any case, sitting there doing nothing but be airflow. (which itself is pretty stupid and wasteful for many reasons, of course tighter cases = more price in most cases)

Also, recovery partitions are mainly for software refreshes rather than failures in general.
It is easier to have it on the HDD than it is to have it on a disc and have to wait due to significantly slower speeds.

Re:Recovery partition is moot (0)

Anonymous Coward | about 3 years ago | (#37656578)

and when you can't boot from a stick cause of drivers, then what??

Re:Recovery partition is moot (1)

vtcodger (957785) | about 3 years ago | (#37655862)

**I've never really understood the purpose of a recovery partition as a means of restoring a system. If a disk fails, a common reason for wanting to restore the PC, then that partition becomes useless. It's much better to just include disks so that a user can restore the PC them selves after the new hard drive is in place.**

I'm pretty much Windowed out and hardly ever use Windows, so I don't pay a lot of attention to PC distribution issues, but my impression is that low end PCs come with a (stupid) recovery partition INSTEAD of an OS CD. I assumed the reason is cost. But I would note in passing that the cheapest PCs often don't even have a cdrom drive.

Redo Backup & Recovery (1)

Anonymous Coward | about 3 years ago | (#37654084)

Redo Backup & Recovery http://redobackup.org/

I use CloneZilla with a backup and restore script on my netbook. However, I use Redo Backup & Recovery for clients computers, It has a nice GUI and can work over a wireless or wired network connection to store backups to a NAS (a nice feature).

Re:Redo Backup & Recovery (1)

hedwards (940851) | about 3 years ago | (#37654350)

I'm going to give that a try. I've been looking for something to handle the bare metal aspect of restoration. I do my main backups to crashplan, but that doesn't really provide me with a convenient way of doing a baremetal back up.

For Linux it's not too hard to go from a base install + backup to one that's where I left it, Windows though is a PITA due to the architecture without jumping through some special hoops.

Re:Redo Backup & Recovery (1)

vtcodger (957785) | about 3 years ago | (#37655938)

**Windows though is a PITA due to the architecture**

Windows has an architecture? Who knew? I've always thought the damn thing had pretty much the beauty and elegance of a third world slum.

Re:Redo Backup & Recovery (1)

AYeomans (322504) | about 3 years ago | (#37655230)

+1 for this. Not at all geeky to use - it's a neat front end to partclone (partclone.org).
Compresses the filesystems, so it can be really fast to restore, especially if you clean it up (CCleaner) and defrag it first.
You can also put this on a bootable CD/DVD with the restore image.

PartedMagic (1)

Anonymous Coward | about 3 years ago | (#37654162)

http://partedmagic.com/doku.php

PartedMagic is a wonderful, well-maintained Linux LiveCD that is quite small (175MB file, 320MB RAM requierd). I keep it on a USB stick on my keychain for recovery/diagnostics. It comes with CloneZilla, solid network support for many chipsets (including wireless), a nice desktop environment and plenty of disk recovery tools. It even has a ready-made PXE bootable version.

If you buy a large enough USB stick (8GB of 16GB), you can fit an image of a brand new Windows install with your favorite applications onto it. Of course, you could always just mount a network drive or an external USB hard drive and store your disk images there. For that matter, you can network boot PartedMagic from PXE or even install it onto the USB external drive.

Re:PartedMagic (0)

Anonymous Coward | about 3 years ago | (#37654220)

Just a note, if you specifically want to mimic the "recovery partition" behavior, you can do that with CloneZilla too, you just need to be careful about how you do your restores, since CloneZilla can restore entire disks OR individual partitions. You can set aside a partition on your HDD (maybe 1/10th of the disk), install PartedMagic onto it and put an images directory on it. You can then configure grub (which will be installed with PartedMagic) to boot from Windows first. Any time you want to refresh your Windows install, select the PartedMagic boot option, load up CloneZilla and restore the /partition/. I haven't tested this; CloneZilla may not allow you to image/restore onto the same device from which you're booted.

BartPE (1)

severett (38602) | about 3 years ago | (#37654268)

I made a BartPE recovery disk with DriveImageXML for the imaging component it worked great.

I made sure the install image fit onto a DVD.

If you're using Windows (2)

magamiako1 (1026318) | about 3 years ago | (#37654334)

Look into the Windows ImageX utility, and make sure to *sysprep* your machines.

Grub4Dos + Clonezilla (0)

Anonymous Coward | about 3 years ago | (#37654360)

I have done exactly what the OP needs using Grub4dos and Clonezilla. Grub4dos creates the boot-time menus to select recovery or OS boot and Clonezilla has documentation on its site for creating an automated restore.
Grub4dos Links: http://sites.google.com/site/grubdos/ , http://reboot.pro/forum/66/ , http://www.rmprepusb.com/documents/rmprepusb-beta-versions (grubinst.exe and grldr are within the Install_RMPrepUSB_Full_2.1.630.zip file)

DD of a GZipped Image (3, Informative)

rhadc (14182) | about 3 years ago | (#37654410)

dd is your primary tool.

zero out your drive so that when you compress it, you get a very small image.
dd if=/dev/zero of=[drive]

Install and configure your OS onto [drive]

dd if=/dev/[drive] | gzip -c > zipped_drive_image.bin.gz

to restore:
gzcat zipped_drive_image.bin.gz | dd of=[drive]

I may be a bit rusty, so the commands may need slight work. I've definitely used this method though, and it has worked well.

Re:DD of a GZipped Image (0)

Anonymous Coward | about 3 years ago | (#37654540)

I use a Linux boot CD, and dd to read/write the recovery partition.
Quick and simple, but it assumes that you have a known-good recovery
partition somewhere to copy.

Re:DD of a GZipped Image (2)

bheading (467684) | about 3 years ago | (#37654764)

Slightly more optimal if you do the first steps in reverse, ie

- install the OS first and do a cleanup on it (eg ccleaner on Windows), uninstall any crap that's on it, clear out logs/tmp files etc.
- within the OS, write a big file full of zeros to fill the drive - ccleaner can do this easily by zeroing any unused space - dd will work if you can mount it from Linux.

Then use dd to capture the image as you suggested.

Re:DD of a GZipped Image (1)

Gaygirlie (1657131) | about 3 years ago | (#37655086)

to restore:
gzcat zipped_drive_image.bin.gz | dd of=[drive]

Not enough. You need to make sure the partition table is correct and that there is a working bootloader on MBR. Easy steps, yes, but forgetting those can make things even worse than they were before attempting restore.

Re:DD of a GZipped Image (0)

Anonymous Coward | about 3 years ago | (#37655244)

I've used this for 10 years now on some Windows NT machines running some industrial software. I've created a small linux partition, and added some GRUB entries for creating and restoring partitions' images.
My costumers already know how it works: when Win NT stops working, they just reboot, choose the "restore last image" option on GRUB boot menu, and 5 minutes later they recovered a 2Gb partition. After 10 years, average has been twice a year...

Re:DD of a GZipped Image (1)

rhadc (14182) | about 3 years ago | (#37655850)

A follow up to some comments on this approach.

On zeroing out your drive or partition:
    If you zero out a drive, whatever you use to get bootstrapping started (traditionally MBR), describing the extents of your volumes (partition table), and your filesystems themselves will not write over most of those zeros. So whether you do it to the whole drive (say.. /dev/sda) or the volume (/dev/sda1) should depend on what you're trying to do and what will be getting imaged.

On the use of DD at the drive or volume level:
- You can back up whole drives, but you must restore to something at least the size of the original drive. Plus, you will lose any additional space when you restore to a larger drive. You may be able to add additional volumes with your partition tool or resize what you have, but you begin to erode the value of this approach.
- You can image the volumes/partitions, but you'll have to ensure that the partition table describing the extent of the partition does so the same way, with the same size.
- The most important thing about either approach is that you have a strong understanding of what is and isn't getting imaged when you use the DD tool.

The craziest thing I have done with this method:
(Circa 2003, I think)
I had 3 PATA drives set up as a Linux RAID 5. Two of the drives relied on the same cable and drive controller.. some of you already know what will go wrong here.. The cable or controller failed, and I had a failed RAID 5 volume that would be risky to rebuild. And it had important files. :) I had to find a way to rebuild it, so I needed to attempt to rebuild from copies.
The three RAIDed drives were /dev/sdb, /dev/sdc, and /dev/sdd, so they were members of the RAID set as whole drives, not partitions.
Using a 250G drive, I created 3 partitions /dev/sda1, /dev/sda2, and sda3, and DDed each raid set member into its respective position on the new drive. I then configured linux to see the three partitions as a raid set. Sure enough, Linux asked if I would like to rebuild the raid set. I said yes, and Linux successfully rebuilt the set into a working RAID5 volume based on 3 partitions that existed on the same disk.

A couple of lessons -
1 - There is no difference between the block device identified as the drive and those identified as partitions on the drive. They are differentiated based on their use by the OS.
2 - Don't be dumb like me. Follow best practices with RAIDs, backups, and protecting your data.

Happy DDing.

The author must be an MS-Windows user (0)

Anonymous Coward | about 3 years ago | (#37654480)

MS-Windows is the only system that needs this kind of tools. The others can simply use backup-tools like dump, tar etc.

Re:The author must be an MS-Windows user (0)

Gaygirlie (1657131) | about 3 years ago | (#37654670)

MS-Windows is the only system that needs this kind of tools. The others can simply use backup-tools like dump, tar etc.

And how do you use those if the system is borked and needs to be restored from a backup, eh? Oh, that's right: you can't.

Why Not Include Recovery Media Instead? (1)

fast turtle (1118037) | about 3 years ago | (#37654510)

It seems that all of the damn MBA's have convinced people that saving a few cents per million units is the way to go. What I'd suggest in regards to customer service is do what the OEM's aren't doing and simply include a physical set of recovery media. This way if they have to replace a failed drive, they've got some way of doing it.

As someone who's had drives fail on OEM hardware (out of warranty) I've always appreciated having physical media. Another issue is that of Virus/Malware infections. I've actually seen brand new systems with virus/malware on the recovery partitions and you can't clean them w/o a full wipe/repartition and if you're going that far, you may as well have physical media to do the job right. Another thing is to include dban with the main recovery disk setup to offer the option to Puke & Nuke the System. If you do that, then don't forget the Warning/Reminder to Backup before Nuking from Orbit.

From an end-user standpoint, I'd love to see the option to do a secure wipe before system restore so I can sell/donate an old system and not have to worry that any of My personal data is still on it.

Re:Why Not Include Recovery Media Instead? (1)

RLaager (200280) | about 3 years ago | (#37654616)

I wish that manufacturers would internally install an SD card or flash drive with the hardware write-protect switch set. This provides all the advantages of optical recovery media (write-protected and separate from the hard drive) plus the advantage of a recovery partition (it's not separate, so it can't get misplaced).

Ship a DVD with it (2)

nurb432 (527695) | about 3 years ago | (#37654730)

While it looks like most people here didn't even read the requirements before they posted ( typical these days ) i did, and i think for the best 'customer expirence' you are best off sending a DVD along with it and not screw with a partition.

it gives them a way to come back from a *dead* drive ( the most likely scenario ) and it gives them something to hold in their hands that will if nothing else make them feel like you care.

Disks are cheap, eat a few pennies in the name of customer service...

Re:Ship a DVD with it (1)

vux984 (928602) | about 3 years ago | (#37655714)

it gives them a way to come back from a *dead* drive ( the most likely scenario ) and it gives them something to hold in their hands that will if nothing else make them feel like you care.

The most likely scenario is a nasty virus/malware infection. Many people would rather just re-pave the hard drive than try and clean it and gamble they were successful.

A physical disk never seems to be around when you need it, and half the time gets scratched or corrupted by the time you need it.

Re:Ship a DVD with it (1)

MoFoQ (584566) | about 3 years ago | (#37655792)

then put the disc in a case and secure the case with the disc inside the computer.

Re:Ship a DVD with it (1)

nurb432 (527695) | about 3 years ago | (#37656232)

Ok, even tho i disagree on the 'main cause' for a restore, would you trust restoring a infected drive from another partition on that same PC? I wouldn't.

Re:Ship a DVD with it (1)

Ayourk (1125735) | about 3 years ago | (#37656236)

Like MoFoQ (584566) [slashdot.org] says, put it in the case and secure it near the HDD so that it can't get lost, but use a flash drive that is equivalent to the recovery partition, that way you can account for the HDD failure and losing recovery media. Having a recovery partition isn't moot. It allows you to restore the system without having to hunt down some sort of recovery media. Doing both ways isn't a total waste as it does offer better value to most users and even some of the advanced users too.

And if the hardware is new enough to boot from USB, then yes, forego the boot partition and hook up this "internal" flash drive up as the recovery partition as RLaager (200280) [slashdot.org] previously stated.

Lately, I've given up on making CDs/DVDs because they are just too bulky. Flash drives are cheap and neatly compact. It isn't hard at all to make a flash drive read-only and bootable these days. Most recovery partitions don't need to be more than 2GB and what does a good quality 2GB flash drive cost these days?

Granted on hardware that won't boot from USB, I do still create a recovery CD in addition to a recovery partition, but storing the media in the case makes sure you can actually "find" the media when needed.

Re:Ship a DVD with it (1)

ben_kelley (234423) | about 3 years ago | (#37658940)

Unless you are shipping the original installation media, don't you have the same issue as the OP in creating a bootable recovery DVD as you do with creating a bootable recovery partition?

DRBL+Clonezilla Server (0)

Anonymous Coward | about 3 years ago | (#37654774)

I have used this in a production environment on at least 4 dozen types of models (netbooks, laptops, and desktop computers). The biggest issue I have found will be finding the correct network drivers for PXE booting and storage of images as they become quite large (30gb to 60gb).

I was a n00b when I first started this project and the FAQ proved to be very useful.

DRBL Sourceforge Page [sourceforge.net]

Cheers,
Anonymous_Coward

DeployStudio? (1)

guruevi (827432) | about 3 years ago | (#37654876)

DeployStudio PC works very nice to deploy a machine. You create an image and then just re-deploy it - it resizes NTFS partitions correctly and have had so far no issues restoring any version of Linux or Windows with any number of partitions.

For a bootable recovery partition, you could put a small Linux (busybox) image with the ntfs tools and dd that automatically runs when you boot it.

Re:DeployStudio? (0)

Anonymous Coward | about 3 years ago | (#37655428)

Does deploystudio PC require the deploystudio server? I've only dealt with restoring images via deploystudios onto Macs via the network (setting up scripts etc to also do dual partition os x/ windows images etc). If the PC version also requires the server, then that's a poor solution in my mind if this is to be setup so the end user can restore if need be

This would take a bit of time, but (0)

Anonymous Coward | about 3 years ago | (#37654922)

These aren't exact instructions, but figured I'd give it a shot.

First, create what will be your recovery partition. Make it big enough to hold your recovery image.

Next, install your system like normal, and use dd + gzip to make an image of your partition containing the OS. Just the partition, don't do a whole-disk copy.

The command would be something like
dd if=/dev/sda2 | gzip -c > image.bin.gz

Then, I'd take some kind of mini-linux distribution, like Tiny Core linux, something like that, and I'd install it to the first partition. Copy the disk image there, and set up Tiny Core so, on boot, it launches some script asking if you'd like to restore the system, and if so, does a command like
gzcat image.bin.gz | dd of=/dev/sda2

Make sure grub is set to boot the OS partition instead of the recovery partition, maybe make it so you have to hit ESC during GRUB's stuff to get into the recovery partition. Done and done.

Then, Clonezilla the whole thing for installing onto your batch of computers.

Re:This would take a bit of time, but (2)

Culture20 (968837) | about 3 years ago | (#37656536)

dd's a poor solution; if it hits a bad block on the drive, the default is the fail. Your best bet is to use a program that recreates the partition, formats it, and copies the data in place like partimage or ghost. Bonus points for not having to copy unused space ( even if you zero the drive first like some suggested, you'll have gigs of wasted space from deleted installation files). Worst case scenario, use ddrescue instead of dd since ddrescue is a little more verbose and has easier options for skipping bad blocks.

Where's the problem ??? (0)

Anonymous Coward | about 3 years ago | (#37655000)

Clonezilla already has the tools to create the partitions also....unless I guess your looking for the tool to make the master recovery partition...
then http://partedmagic.com/doku.php

also look at http://ping.windowsdream.com/

either are excellant

Use partimage (0)

Anonymous Coward | about 3 years ago | (#37655186)

I've done this on some computers for my family, they are all windows users. Once I get their install to the point that I want, I install Ubuntu. Then I use "partimage" to backup the windows partition to the Ubuntu partition. I usually make the Ubuntu partition around 10Gigs. partimage will compress the backup, and also only back up allocated portions of the NTFS partition. Partimage isn't the only one out there, there's a few others. Restoring windows is pretty fast, only takes half an hour. I create a custom shortcut on the Ubuntu desktop that automates the procedure, so that I don't have to get involved during the recovery.

PartImage is Not Ghost (PING) (1)

ternarybit (1363339) | about 3 years ago | (#37655222)

I was in a very similar situation as OP and found PING [windowsdream.com] very helpful. It doesn't provide any automated way of creating a recovery partition, but the documentation does explain how to make automated system restore discs. The principle is nearly the same, so adapting it shouldn't be too hard.

Off the cuff, I imagine it would go like this:

  • Deploy a clonezilla image to a host machine
  • Create a recovery partition with gparted or similar. The recovery partition need only be about 30-40% of the total occupied space of the system partition (thanks gzip!)
  • Install PING to the recovery partition. I'll leave this as an exercise to the reader.
  • Install GRUB to the MBR, creating entries for Windows and PING's kernel
  • Create a system restore image with PING and save it to the recovery partition
  • Tweak the KERNEL line in GRUB with the appropriate automation. The PING documentation is very helpful with this (see above link)
  • Once you have everything set up just right, you can then create a master clonezilla image of the entire hard disk to deploy to identical machines.

The main downside to this is it relies on GRUB, which may not be desirable to your customers. It's also tedious to set up.

It's really worth mentioning that creating an automated restore disc [windowsdream.com] is much easier.

I've done it a few ways (2)

forgottenusername (1495209) | about 3 years ago | (#37655234)

1) dd mbr + data on disk

2) sfdisk partition data, then use xfsdump/xfsrestore to recreate the partition data on disk

Both of those have the advantage of being easily scriptable, and a disadvantage of being fairly dificult to deal with variable disk sizes without doing quite a bit more work.

You could also look at partimage which may be more what you had in mind - http://www.partimage.org/Main_Page [partimage.org]

fsarchiver (1)

hoggoth (414195) | about 3 years ago | (#37656474)

I use fsarchiver, and as far as I can tell it is better in every way than ntfsclone, clonezilla, et al.

Re:fsarchiver (0)

Anonymous Coward | about 3 years ago | (#37656752)

Surprised at the lack of love for fsarchiver. Multi-threaded compression / decompression, NTFS support, file-by-file recovery (so if the archive gets corrupt, only the individual impacted files become corrupt, not the entire archive), extensive CLI, low resource usage ... fsarchiver is the unsung hero of the FOSS world. Wrap a bash script around it, tighten up your Linux boot environment, create a "recover / recover" user, auto-fire it, and you're set. All they have to do is boot in and *bam*, instant hassle-free recovery.

You'll have no problem wrapping a simple XP or 7 installation down to a gig or two (or less).

My ONLY gripe about fsarchiver is that the NTFS file structures it rebuilts are horribly fragmented. I understand that nothing other a block-by-block

Trinity Rescue Kit (0)

Anonymous Coward | about 3 years ago | (#37656598)

The Trinity Rescue Kit, a live CD-based toolkit, has an OS cloner and some MS recovery tools
http://trinityhome.org/Home/index.php

Trinity Rescue Kit or TRK is a free live Linux distribution that aims specifically at recovery and repair operations on Windows machines, but is equally usable for Linux recovery issues. Since version 3.4 it has an easy to use scrollable text menu.
Here 's a sumup of some of the most important features:

-easily reset windows passwords with the improved winpass tool
-simple and easy menu interface
-5 different virusscan products integrated in a single uniform commandline with online update capability
-full ntfs write support thanks to ntfs-3g
-winclean, a utility that cleans up all sorts of unnecessary temporary files on your computer.
-clone computers over the network via multicast.
-wide range of hardware support (kernel 2.6.35 )
-contributed backup utility called "pi", to automate local machine backups
-easy script to find and mount all local filesystems
-self update capability to include and update all virusscanners + local changes you made to TRK.
-full proxyserver support.
-run a samba fileserver (windows like filesharing)
-run a ssh server
-recovery and undeletion of files with utilities and procedures
-recovery of lost partitions
-evacuation of dying disks
-full read/write and rpm support
-UTF-8 international character support (select keyboard language from the scrollable textmenu at startup)
-2 rootkit detection uitilities
-most software updated to recent versions
-literally thousands of changes and bugfixes since version 3.3
-elaborated documentation, including manpages for all commands (also TRK 's own)

Re:Trinity Rescue Kit (1)

marky_boi (1427845) | about 3 years ago | (#37657244)

LOL.... ""./"" 'd already...............

You're doing Windows. Use Microsoft's toolset. (1)

Ritchie70 (860516) | about 3 years ago | (#37658174)

We actually have something very much like this on the systems we deploy at work.

The boot menu has a "don't do this unless support tells you to" option.

If the user selects that option, it boots WinPE off a different partition. That Windows session puts up a message box for confirmation, then uses imagex to explode multiple WIM files out to the normal live partitions.

The way we load the boxes initially actually just adds one more step to this. Boot WinPE off DVD, partition the hard drive, copy the recovery partition's contents from DVD to hard drive, mark the "don't do this" boot menu as the default, and reboot. It then picks up with the WinPE off the hard drive recovery partition, which in turn loads the normal partitions. It works pretty well.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?