Please create an account to participate in the Slashdot moderation system


Forgot your password?
Businesses Data Storage Software

Ask Slashdot: Create Custom Recovery Partitions With FOSS? 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?"
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Create Custom Recovery Partitions With FOSS?

Comments Filter:
  • dd (Score:3, Funny)

    by Hatta ( 162192 ) on Sunday October 09, 2011 @10:45AM (#37653908) Journal


    • 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.
      • by m6ack ( 922653 )

        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...

        • 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.

          • by zoloto ( 586738 )
            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!
          • dd is suboptimal for this because it doesn't zero out unused sectors. For linux filesystems, clone2fs is the equivalent command. I don't know if something similar is available on OS X.
      • Re: (Score:3, Informative)

        by zougloub ( 1166719 )
        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 f
        • Re: (Score:3, Interesting)

          by Ayourk ( 1125735 )
          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.
    • 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 s

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

      • by Anonymous Coward

        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 -

        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 t

      • 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.
      • they don't sell new anymore, but that is what they did once setup.

        you hit a button on the harddrive, and it ran a backup process.,2817,1230418,00.asp#fbid=t9YT9-CRkJe []

        found this from 2003....

        apparently, they didn't last.. (nor maxtor)

      • The opensource MyWorkSafe is pretty close to what you're asking for. It works like this:
        a) Install MyWorkSafe. Configuration is unnecessary.
        b) Connect a USB drive.
        c) MyWorkSafe asks "Do you want to use this drive for backups?"
        d) If you answer "No", then you'll never be prompted for that drive again. If you answer "Yes", then a backup will run automatically every time you insert that drive.

        MyWorkSafe is intended to be used with USB flash drives, so it actually prioritizes certain types of files, while sk

    • 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

    • 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

      • by rwa2 ( 4391 ) *

        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

        • Yeah, my initial drive-imaging experiences were with Ghost, but I gave it up when I got serious about imaging our systems.

          PING is much better in my opinion, and not just because it is free.

          It does have a resizing-on-the-fly capability (during image creation). I don't use it because I've simply standardized on a 25GB partition for Windows system & programs. I rarely use more than 15GB. Data lives on a different partition with file-level backup.

          I boot PING from a USB stick, and save the disk images to an

    • by unitron ( 5733 )


      Better yet, dd_rescue so that you can use the -v option and see what's going on.

  • by vlm ( 69642 ) on Sunday October 09, 2011 @10:50AM (#37653938)

    partimage []

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

    • Sounds like a great idea, but it seems like NTFS support is still experimental. Has anyone tried this?
      • No. Everybody is waiting until it reaches v0.1

      • 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.
      • Yep. No problems at all, but then I don't think the partition had any encrypted streams to cope with. Windows 7.
    • 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
      • by pnutjam ( 523990 )
        I've been using fsarchiver, [] 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 on a live CD.

    • 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.
  • 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: (Score:3, Informative)

      by FalleStar ( 847778 )

      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
  • by bwcbwc ( 601780 ) on Sunday October 09, 2011 @11:00AM (#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.

    • by pnutjam ( 523990 )
      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 (Score:2, Informative)

    by Kr1ll1n ( 579971 )

    Works off of PXE boot.... []

    • by Kr1ll1n ( 579971 )

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

    • by mrmeval ( 662166 )

      A 'minor bug' that demands they rip that version off their server and that users don't use it. []

      • 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?

  • by Anonymous Coward

    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

    • by poity ( 465672 )

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

    • you can build the XP iso with driverpacks []. 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 [] 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.

    • [...] 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?

      • 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.

      • by swalve ( 1980968 )
        They are the drivers and software that worked when the computer was new, so it would work just fine.
      • **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

      • by Ayourk ( 1125735 )

        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.

    • **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

    • by Jaruzel ( 804522 )

      Oh yeah... They are in a hotel room at 1am trying to complete some urgent work and their laptop throws a panic, resulting in an emergency OS re-install and you are wanting them to go out and find DVD-Rs? Optical drives are becoming increasingly uncommon on lighter laptops so a recovery partition that rebuilds the boot OS back to day 1 is the least inconvenient option.


  • by Anonymous Coward

    Redo Backup & Recovery

    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).

    • 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.

      • **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.

    • +1 for this. Not at all geeky to use - it's a neat front end to partclone (
      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.

  • by Anonymous Coward

    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

  • 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.

  • by magamiako1 ( 1026318 ) on Sunday October 09, 2011 @11:56AM (#37654334)
    Look into the Windows ImageX utility, and make sure to *sysprep* your machines.
  • by rhadc ( 14182 ) on Sunday October 09, 2011 @12:09PM (#37654410) Journal

    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.

    • 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.

    • 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.

    • by rhadc ( 14182 )

      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 o

  • 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 actuall

    • by RLaager ( 200280 )

      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).

      • Most PC motherboards have some unused on-board usb ports (with pins).

        You can use a "pins to usb-B" cable to plug a usb key with a R/RW switch.

        This cable is usually provided, otherwise a DIY will do, pin-out is in the mobo reference doc.
        Then USB keys with a read only switch are not common, I have an old one but I didn't found any lately. You still can use a SD card with an adapter.

  • by Aggrajag ( 716041 ) on Sunday October 09, 2011 @12:29PM (#37654570)
    The following thread has a guide on how to create a Windows 7 recovery partition: []
  • by nurb432 ( 527695 ) on Sunday October 09, 2011 @12:49PM (#37654730) Homepage Journal

    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...

    • by vux984 ( 928602 )

      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.

      • by MoFoQ ( 584566 )

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

        • OK, not sure how serious you where with putting the disk inside the PC. But I can't say how happy I was the day I found the original drivers/software/manuals for some hardware inside a PC case.

          I'd also suggest putting the biz name on the CD, since the guy that finds it won't know where it's from. But you might get some business from it! I know I would consider buying from somebody like that. (or more likely suggesting that the customer continue to purchase from you)

          Side note, must be getting old as that was

      • by nurb432 ( 527695 )

        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.

      • by Ayourk ( 1125735 )

        Like MoFoQ (584566) [] 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 hardwa

    • 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?
  • 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.

  • I was in a very similar situation as OP and found PING [] 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 o
  • 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 - []

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

  • 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 pa

  • I have slax set up with partimage. Here are the steps I take
    1. Create a 5 gig partition for the backup image
    2. Create a folder on the hard drive named slax and copy all the files from the slax CD into this folder.
    3. Create a recovery script that goes in C:\slax\rootcopy\usr\bin
    4. Create a link to it using a .desktop file like C:\slax\rootcopy\root\Desktop\recovery.desktop
    5. Rename C:\NTLDR to C:\NTLDRXP
    6. Rename the GRUB4DOS bootlader to C:\NTLDR
    7. Have C:\Menu.lst have 2 options. 1 to boot the default os

  • Partition backups are unwieldy, inefficient and inconvenient. They basically assume that you'll be restoring to the same hard drive model. Back up files instead. I use rsync on Linux and vshadow+robocopy on Windows.

  • * prepare image (partimage - my choice, fsarchiver, ntfsclone, dd or whatever works for you), put on disk with the rest of the iles (sample: /image/diskc.000).
    * put file named "autorun" in root dir
    * if partition: the "rename NTLDR/BOOTMGR, put GRLDR in it's place" installation of GRUB4DOS is the simplest and survives various "repair boot sector" procedures
    * if partition: hide the recovery partition, make GRUB4DOS only show additional menu if Esc key pressed (hiddenmenu command)

    < sample autorun file >

Any sufficiently advanced technology is indistinguishable from a rigged demo.