LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-10-2013, 08:53 AM   #1
Tassadar
LQ Newbie
 
Registered: Jul 2013
Posts: 27

Rep: Reputation: Disabled
Question How to create a recovery partition?


Hi all,

I have been using linux (Kubuntu x64 to be exact) for a few months and I use an bootable Clonezilla USB drive to make and recover images of the system, and works great.

Now I want to make in the hard drive a recovery partition that will allow me to press a key or something similar when booting the computer and then go to a recovery option with what I can restore the computer to the default state.

I need all to be in the internal hard drive, not on a USB drive, and I need the recovery process to be easy to use (I don't wan't to have to select partitions or other options).

Mainly, I understand that making this can be a bit difficult, but I don't mind, the question is that the result, i mean, the recovery option must be simple and easy to use.

Anyone knows how could I do this?

Many thanks in advance
 
Old 07-10-2013, 10:00 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Just another boot entry to grub. Get a free partition. Copy the content of the USB stick to it. Rerun grub and up you go.

How to do the actual recovery is something to fiddle out. But Maybe something like
Code:
#confile
/ /dev/sda2
/boot /dev/sda1
/nother /dev/sdan
Code:
loop through conffile
mount $2 /target/$1
tar -xzf /root/your_backup_archive /target
mount -t proc /target/proc
mount -t sysfs /target/sys
mount -t devfs /target/dev
mount -t devpts /target/dev/pts
chroot /target
grub-setup or grub-install
After that leave chroot with CTRL-D and reboot.
 
Old 07-10-2013, 10:11 AM   #3
Tassadar
LQ Newbie
 
Registered: Jul 2013
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by zhjim View Post
Just another boot entry to grub. Get a free partition. Copy the content of the USB stick to it. Rerun grub and up you go.

How to do the actual recovery is something to fiddle out. But Maybe something like
Code:
#confile
/ /dev/sda2
/boot /dev/sda1
/nother /dev/sdan
Code:
loop through conffile
mount $2 /target/$1
tar -xzf /root/your_backup_archive /target
mount -t proc /target/proc
mount -t sysfs /target/sys
mount -t devfs /target/dev
mount -t devpts /target/dev/pts
chroot /target
grub-setup or grub-install
After that leave chroot with CTRL-D and reboot.
Many thanks for the answer, zhjim.

In other forum I've been reccomended to use PING, do you know it??

Your answer seems to me an easier way, if i understand ok I would have to make a second partition in with copy the content of clonezilla USB drive and then configure the ability to boot from it, am I wrong?

I suppose that I would have to configure clonezilla to auto-do it instead of having to do all the steps i make now when i recover booting from usb and selecting image from a second hard disk.

To be honest, I come from "windows world" and i've been with linux only around 3 months, so I've install it using "installation for dumbs using whole hard disk", so I have still not handle partitions in linux, and the word grub is something I've heard but I really don't know what is. I don't know how to resize the partition I've now that takes the whole disk and create the second partition for containing clonezilla and the image to restore.

I obviously don't want you to explain me everything step-by-step, I have to work on in and google for info, but I sincerely would thank you a bit detailed help that could save me hours and hours of research. If you can reccomend me some tutorials related with whis it would be great.

I really don't know where to enter those codes you attach me...

Many thanks
 
Old 07-10-2013, 10:52 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
http://www.linuxquestions.org/questi...6/#post4904425
 
Old 07-10-2013, 11:49 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
As far as it comes to the second grub entry you got it right. You would have one partition with clonezilla and your backup data. Then run the script I posted. Also the "code" I posted was only pseudo and needs to be extended quite a lot. The idea behind is that as soon as you booted into the recovery system that a script is run that mounts paritition for your "new" system, copies all the "old" files over there and then jumps into this system so it is seen as beeing the "real" system. This makes it easier to install grub (boot loader) cause it gets installed from within the "new" system. Just something one has to try out. Its no black magic but some voodo might be included

Depending if you want a recovery only or a backup system as well I can guide you some way.
What filesystem did Kubuntu use for that one big partitin? ext4? That would at least make the repartitioning a bit easier. Way to go about is FIRST to shrink the filesystem and then shrink the partition. Thing here is that you have to get the numbers right. Might be easier to just kill the partition table. Create a new one and then use clonezilla to get your system back online.

Some random question to get a better idea
In what format does clonezilla save it's files? Tar, zip? Or some unkown stuff?
Can you give a path to restore a system or does it need a partition?
Just tell us some things about your system right now. Like the output of following commands

Code:
mount
df -h
fdisk -l

Last edited by zhjim; 07-10-2013 at 12:00 PM. Reason: took a deeper look at ping. no way
 
Old 07-17-2013, 08:55 AM   #6
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Check this out. Seems to be just what you want: http://www.progob.nl/robmaaseu/index...n-at-no-costs/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to create windows recovery disc ravisingh1 General 3 05-08-2013 03:41 PM
How to Create System Recovery Partition in Linux Ubuntu melodyintrance Linux - Newbie 7 03-24-2013 09:49 PM
how to create usb recovery boot stick? gunzzz5930 Slackware 3 05-18-2010 08:54 PM
How to create a disaster recovery of my files automatically sacoskun Linux - Software 1 04-07-2008 08:49 PM
partition recovery cgetty Linux - Software 3 04-18-2005 10:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration