Ask Slashdot: Create Custom Recovery Partitions With FOSS?
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?"
dd
Give me Classic Slashdot or give me death!
partimage
http://www.partimage.org/Main_Page
I haven't used it since probably 2005 or so, but it used to work quite well over the network.
"Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
Gparted on a live CD.
And grub
testdisk by christophe grenier
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
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.
We are the 198 proof..
Comment removed based on user account deletion
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.
Comment removed based on user account deletion
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).
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.
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.
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.
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.
Look into the Windows ImageX utility, and make sure to *sysprep* your machines.
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 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.
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
I'd go on a Vegan diet but the delivery time from Vega is too long. --brownkitty
MS-Windows is the only system that needs this kind of tools. The others can simply use backup-tools like dump, tar etc.
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.
Mod me up/Mod me down: I wont frown as I've no crown
The following thread has a guide on how to create a Windows 7 recovery partition:
http://forums.mydigitallife.info/threads/21978-Windows-7-OEM-Recovery-Partition-tools-creator-Free
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...
---- Booth was a patriot ----
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
Cheers,
Anonymous_Coward
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.
Custom electronics and digital signage for your business: www.evcircuits.com
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.
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
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.
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:
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 is much easier.
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
I use fsarchiver, and as far as I can tell it is better in every way than ntfsclone, clonezilla, et al.
- For the complete works of Shakespeare: cat
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?
Here's to the crazy ones
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)
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.
http://www.pcmag.com/article2/0,2817,1230418,00.asp#fbid=t9YT9-CRkJe
found this from 2003....
apparently, they didn't last.. (nor maxtor)
every day http://en.wikipedia.org/wiki/Special:Random
http://ur1.ca/5ck1s
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.
The preferred solution is to not have a problem.
Comment removed based on user account deletion
I have slax set up with partimage. Here are the steps I take .desktop file like C:\slax\rootcopy\root\Desktop\recovery.desktop
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
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 after 5 seconds and another option to load slax.
8. Boot to slax. If you like zero out the pagefile get get better compression dd if=/dev/zero of=/mnt/hda1/pagefile.sys bs=1M count=1524 then umount hda1 and use partimage to create a backup on hda2.
This way slax is loaded off the hard drive and into RAM and automatically mounts both /dev/hda1 and /dev/hda2. The recovery script unmounts hda1 and uses the image on hd2 to restore hda1.
Since an XP install easily will fit on a 4GB DVD you can instead make a recovery DVD with slax where the recovery image is on the DVD instead of the hard drive.
Or you can make a recovery CD that just boots a copy of slax and expects to have a recovery image file on hda2.
In my case I work at a company with 7 locations and a server at each location. I have the slax setup on each XP workstation and the latest recovery image stored on the server. We don't use roaming profiles due to Outlook with Exchange. But if someone is having a problem with a system I convert their profile to a romaning profile, it backs up to the server, I then reboot the computer to slax (by modifying menu.lst) mount the networkshare, reimage the hard drive, reboot, rejoin the domain and log in with the roaming profile. At that point I convert the profile back to nonromaing. And set up the local printer.
I would be more than willing to provide in depth details, scripts and instructions on how to remaster slax ans necessary.
vi +
I was using Norton ghost, but then I stumbled onto EaseUS Todo Backup. It's much faster and more reliable than Norton, and best of all - FREE. Only problem I've had is with incremental backups. It can image the drive while Windows is running or when you've booted into the recovery console.
Recovery console runs both on Linux and WinPE.
I don't know exactly what you're looking for, but if you want to create a different boot partition which you can boot into using e.g. windows bootloader (or USB/DVD) and then do a system restore from there, then this is your product.
PS. they also have a bunch of other related free products.
Microsoft Deployment Toolkit is what we use where I work. It uses the ImageX component but allows you to have a nice clean interface to build out your images. You can deploy using the PXE, ISO, or other options and there are ways of building out a full zero-touch install of windows and other applications. We use it to install Windows, run all updates, and install applications so we do not have to babysit an install process. You can find it below:
http://technet.microsoft.com/en-us/solutionaccelerators/dd407791
It's main component is the Windows Automation Toolkit which contains WinPE and ImageX, but the deployment toolkit just makes it easier to control.
Best part is that it is FREE for anyone to use.
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.
"When information is power, privacy is freedom" - Jah-Wren Ryel
PING is a simple Linux system with an interface to PartImage. See: URL:http://ping.windowsdream.com/>
I use version 2.01.19 regularly to backup drive partitions formatted in NTFS or ext2-4. It writes the compressed recovery files to NTFS, ext# or a network drive.
It has often saved my bacon.
Ive had a lot of success simply tar-ing entire file systems, including recovery partitions. My only problems so far have been with windows 7-based systems as the new boot process uses GUIDs, which are of course different for each harddrive (including same vendor/model). If anyone knows how to generate this GUID from linux and then hack the registry to make it boot, please elaborate :) Tar-ing a "generic" windows 7 system and using that instead works quite well. You can use any distro (slitaz, puppy linux) and modify init.d scripts to automagically untar your image(s) to the destination computer.
If you dig a bit deeper in Clonezilla's options, you will find that it can be done easily.
So, here's what I see missing from this equation:
1) How much crapware are you loading onto machines that you need an entire partition dedicated to bringing the machine back up to 'spec'? Most small computer shops don't have the licenses to load stuff like Office, etc, onto pre-sale machines, so either you're planning to load a lot of Open Source stuff, or you've overthought this by miles. The reason Dell/Acer/ and other shit-machine shops use a 'recovery partition' is to screw the user into having to use their OEM licensed crap in a way they control. This is not the model you want to emulate.
2) What's the use of a 'recovery partition'? With Win7 and most modern OS loads, *most* hardware has available common Windows drivers in the OS. Stuff that requires additional drivers (RAID controllers, etc) are generally going to need those drivers presented to an OS load/pre-build - not after the fact. This makes the Recovery parition, essentially, useless. If nothing else, when trying to restore an OS or reload the disk, you now have one useless partition to work around.I'm not sure what you think you're gaining here.
3) Are you using OEM copies of Windows? How do you plan to avoid the OEM license issue of loading onto a new machine? Are you reloading the OS? If so, what's the point of a Recovery Partition?
When you're a small shop, you have small resources available to you. There are lots of solutions out there that will allow you to load custom software onto machines as dictated, etc. If you're just loading the OS and all builds are pretty much the same, a *partition* for this is essentially stupid. Small shops *especially* need to avoid licensing fiascos of what software they are imaging onto machines and pre-loading them as well, as you can't afford lawsuits.
Make a custom build of the PC's you're loading onto every machine, create a folder on the disk for the necessary non-included drivers, and then seal that bastard up as an image and deploy it to your new builds. If you're preloading software in varying configurations, there are easy easy ways to setup install scripts from a repository, etc.
But, from what your question is, it's hard to tell why you would even need something like this. I worked in retail build shop for years and built thousands of machines for them (not Best Buy or some shit, but a real PC shop).
And FWIW, the build monkeys out there who work in 'IT' and 'deploy' machines have no goddamn clue what the ramifications are compared to what you are working with in a local Comp Shop. It's a vastly different process when working in a shop with VL keys they can shit out all day, or not having to worry about big differences in machine builds, or OEM licenses deactivating, etc, than in a retail shop. If Joe Network Douche has an issue, just reimage his machine! Try doing that with a PO'd retail customer and see where that gets you.
My advice: unless you NEED a recovery 'partition', this is a waste of your time. Why not just load the stupid drivers onto the hard disk? Partitioning a drive doesn't save you disk space, having an extra partition causes you more work, and there is instrinsically little to no value to this if you know how to build your OS the right way.
* 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).
/dev/sda1 /mnt/cdrom/image/diskc.000
/mnt/cdrom (unless you choose to load to RAM)
* 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 >
#!/bin/sh
echo "** Are you really sure that you want to restore the system drive C:,**"
echo "** all installed programs and all data to freshly installed state?**"
echo ""
echo "** This will delete ALL user data (documents, pictures etc.)**"
echo "** so you should try to save the most important stuff on a pendrive**"
echo "** or portable hard disk first. If Windows does not boot, try this:**"
echo "** - press Alt+Ctrl+Del here**"
echo "** - as your computer is rebooting, keep tapping F8 (once a second)**"
echo "** until you see a menu with "Safe Mode" option on top. Activate it.**"
echo ""
echo "** If you want to continue, write: YES (has to be capitals)**"
echo "** then hit the Enter key**"
echo ""
echo "** If you write anything else, the computer will start in a rescue**"
echo "** mode (ie. System Rescue CD).**"
echo ""
echo ""
echo "** THIS IS YOUR LAST WARNING BEFORE OVERWRITING THE DRIVE C:**"
echo ""
read wpisal
if [ "$wpisal" = "YES" ];
then
echo "Here we go"
partimage -f2 -b restore
sync
shutdown -r now
else
echo "You typed: $wpisal, not YES; starting Linux"
echo "press any key to continue or Alt+Ctrl+Del to reboot"
read -n 1 -s
fi
-- < sample autorun file > --
* if DVD: make image of recovery partition (with image of system partition) rather than system partition,
* if DVD: adjust default kernel loading timeout in isolinux,
* if DVD: an option to re-write mbr makes sense in case the HDD was replaced
System Rescue CD always mounts it's media on
The disclaimer is going to be different in case of DVD recovery, obviously.
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.