LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-31-2006, 02:05 PM   #1
nykey
Member
 
Registered: Nov 2003
Posts: 360

Rep: Reputation: 30
Help needed for backing up and restoring Slackware 10.2


Hi. I'm what most of you would call a "noob" so I might require a bit step-by-step help if someone could take the necessary time. Now, I have 2 harddrives with 1 partition on each (ReiserFS). First is mounted / and second harddrive mounted as /tmp. I would like to backup all my system from hda1 (First harddrive) to hdd1 (Second harddrive) so I can restore my system back to the state of when I backed it up whenever is needed. The reason I want to do this is because I want to try recompile the kernel and switch from v2.4 kernel series to v2.6 and in case anything goes wrong ... RESTORE, and because you never know when the unexpected happens. I'll be waiting help, opinions, everything that might help me learn and achieve this. Thank you all in advance.
 
Old 05-31-2006, 02:18 PM   #2
SlackTux
Member
 
Registered: Jul 2004
Location: Lisbon
Distribution: Slackware
Posts: 39

Rep: Reputation: 15
I don't think you need to backup everything. If you're just going to compile a 2.6.x kernel, the only thing you can "broke" is the kernel so if you just maintain the option on lilo to boot to your current kernel, if the new kernel compilation doen't work, reboot, enter Linux using the previous kernel (maintain the option to boot to your current kernel on lilo) and try to re-compile the 2.6.x again.

Hope it helped!
 
Old 05-31-2006, 02:34 PM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
I have this line in my /etc/lilo.conf:
Code:
prompt
timeout = 50

image = /boot/vmlinuz
  root = /dev/hda2
  label = Linux
  read-only 
# Linux bootable partition config ends

#Linux bootable partition begins
image = /boot/vmlinuz.old
  root=/dev/hda2
  label = Linux.old
  read-only
# Linux bootable partition config ends
make sure you use the correct device for your root partition.

Then I compile my kernel with this script (which I put in the kernel source dir):
Code:
#!/bin/bash
cp -f /boot/vmlinuz /boot/vmlinuz.old
cp -f /boot/System.map /boot/System.map.old

echo
make clean && make && make modules && make modules_install && make install
This will back up your kernel every time you compile, and with the above lilo options, you will always have the option to boot into the last good kernel.

regards,
...drkstr

Last edited by drkstr; 05-31-2006 at 02:35 PM.
 
Old 05-31-2006, 02:43 PM   #4
nykey
Member
 
Registered: Nov 2003
Posts: 360

Original Poster
Rep: Reputation: 30
Ok, thanks this was helpfull and I will keep that in mind and go on with the kernel recompilation, but still as I said, it would be good if someone would post a good (working) way to backup and restore from hard to hard, cause I still want to keep a backup of all the updates, configs, etc. I have in case of "who knows".
 
Old 05-31-2006, 03:19 PM   #5
RHTopics
Member
 
Registered: May 2006
Posts: 45

Rep: Reputation: 3
nykey,

Using a live CD, like KNOPPIX, I would reccomend using "partimage" to make a compressed image copy of your drive hda1 and store it on your second drive hdd1.

A very good book to own is "KNOPPIX HACKS" by Kyle Rankin. It comes with a KNOPPIX 3.4 on a CD-ROM. Although it is not the latest version of KNOPPIX, it is a stable version. This book contains several different approaches to backing and restoring hard drives.

I just successfully used "partimage" to replace a faulty hard drive. The main advantage of using a Live CD is that the hard drive your backing up is not mounted.
 
Old 05-31-2006, 03:23 PM   #6
nykey
Member
 
Registered: Nov 2003
Posts: 360

Original Poster
Rep: Reputation: 30
THAT'S IT. Something like that I was looking for. I will try this way later on and let you know if it worked for me too. Till later. Cheers.
 
Old 05-31-2006, 05:40 PM   #7
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
you can also issue the command 'dd if=/dev/hda1 of=/dev/hda2' where /dev/hda1 is the da source partition, and /dev/hda2 is the correct destination partition. However, backing up an entire partition just to recompile the kernel is a gross waste of disk space. You are backing up Gigs of data when you only really need to back up about 5mb or so.

regards,
...drkstr
 
Old 05-31-2006, 11:43 PM   #8
nykey
Member
 
Registered: Nov 2003
Posts: 360

Original Poster
Rep: Reputation: 30
[HTML]nykey@nykey:~$ df -ha
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 75G 17G 58G 23% /
proc 0 0 0 - /proc
/dev/hdd1 75G 825M 74G 2% /tmp
devpts 0 0 0 - /dev/pts
usbfs 0 0 0 - /proc/bus/usb[/HTML]

I don't think space is a problem, at least for now. And as I said, I'm not doing this just because of the kernel recompilation. That was my main reason but after reading what you've all said I know how to recompile it now and be safe, but still I want to have a backup (exact image) of my Slackware disk on the other disk, cause you never know when one may fail or any other reason. Thanks for your interest and tips once more.

Btw RHTopics I've found "SystemRescueCd", actually followed the link from PartImage's website. It is, and I
Quote:
SystemRescueCd is a linux system on a bootable cdrom for repairing your system and your data after a crash. It also aims to provide an easy way to carry out admin tasks on your computer, such as creating and editing the partitions of the hard disk. It contains a lot of system utilities (parted, partimage, fstools, ...) and basic ones (editors, midnight commander, network tools). It aims to be very easy to use: just boot from the cdrom, and you can do everything. The kernel of the system supports most important file systems (ext2/ext3, reiserfs, reiser4, xfs, jfs, vfat, ntfs, iso9660), and network ones (samba and nfs).
I decided to use it, or at least give it a try because it's only 120Mb and after all it's specialized on this sort of things. So if anyone has the same problem/question like me, stay tuned and I'll post the results.
 
Old 06-01-2006, 02:13 AM   #9
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
I want to have a backup (exact image) of my Slackware disk on the other disk, cause you never know when one may fail or any other reason.
Aint that the truth

Yes, I can see that disk space is not an issue so there would be no harm in backing up your entire file system. Let me know how it works out for you, maybe I will look into doing it myself. Right now I just have my important system files backed up in a slackware package I created with 'makepkg'. It will also install a number of programs I have acquired over the ages that do not come with slackware. If I had the space though, it would be nice to just switch over to a saved image of the file system at the drop of a hat. Maybe you can even set something up where you can back up a good image periodically by just issuing a command from the console.

Let me know how it goes.

regards,
...drkstr
 
Old 06-01-2006, 03:50 AM   #10
nykey
Member
 
Registered: Nov 2003
Posts: 360

Original Poster
Rep: Reputation: 30
Lightbulb SystemRescueCD - THE BEST

Okay, so I've tried SystemRescueCD and I might say I was impressed straight from when it booted, actually recognized alot of stuff exactly as it should (most if not all full linux distros i've used untill now couldn't do smth like this... too bad this is just a RescueCD , anyway). You will have many options at boot time like: video mode, net support, dma on/off for problematic IDE's, etc. etc. Once in you can type: partimage to start the Image making wizzard ( or partimagessl if you planning on savind the Image on a ftp server with SSL support ) or you can use QtParted (or smth like that) to resize, format, delete partitons (it's actually a Partition Magic clone, very easy for Ex-Windows users or dual booters even )

Good, so I just wanted to backup ALL my slackware system as it is in this moment so I just used partimage. Here's how I did it:

SystemRescueCD does not mount any of your hd's by default (very good) so I mounted my hdd1 partiton (had to edit /etc/fstab and add the entry). Afterwards just started partimage choosed to make image of hda1 then path and filename (eg. /mnt/hdd1/slackware) then choosed compression level (I did them all 3.. almost) and started the process. Now let me expose the results I got (and remember this are my results and yours might be less or more depending on your PC hardware and so on.. :P).

So my whole system was about 2.91GiB. With NO COMPRESSION I've got a 2.91GiB image file in 1m:54sec. With .gz compression I've got a 1.1GiB image file in 7m:50sec. The .bz2 compression (highest) was taking too long to make the image file (aprox. 27-28m) and got this WARNING MESSAGE before I started the process:
Code:
Because of a bug you won't be able to restore MBR from any bzip2 compressed image unless you manually run bzip2 -d on them.
Yes I might have chances of a <700MB image file with .bz2 compression and write it on a CD for higher security and diskspace but I prefer not, after seeing that WARNING message... you never know. But those who make a image of a system lighter than mine have good chances of getting the image on a CD with .gz compression.

Hopefully this helped, I'm not much of a writer or guider but wanted to share my toughts and what I've found and learned. The bottom line is that if you want to Backup/Restore your system this is the best option (in my oppinion) as the image file save's your WHOLE system as is for later restoring. Cheers, and feel free to ask anything.
 
Old 06-01-2006, 05:17 AM   #11
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 37
Your guiding just fine. How about the last step of actually restoring from your created image? As in use SystemRescueCD to create image on hdd1, reboot & touch/create /home/me/'mynewfile', use SystemReccueCD to restore, is 'mynewfile' gone?
Now's the time for adages like no pain no gain; only the brave die young; etc....
Good luck
 
Old 06-01-2006, 01:06 PM   #12
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
The easiest and best way I know how to backup and restore is easy

ls > /backup

pico backup then make sure it is alighned and has the below in it

tar -zcvf slackbackup.tar.gz /dev /boot /bin /opt and all those other folders in / other then /proc and /sys because then it will screw up
save it

chmod +x backup

./backup

After you tar it all up, ftp it to the backup computer or put it on another harddrive or whatever

then to restore,

boot with the cd or something and mount the drive that has the backup and mount the drive that you want to restore onto.

when it is mounted you untar the tar file

so tar -zxvf slackbackup.tar.gz /mountedimagelocation

then you do

mkdir /proc
mkdir /sys

reboot, put in a floppy and boot into it (mount root=/dev/hda1)

run lilo then reboot again and everything will be fine.

It might seem a bit hard, but it's easy. If you need more help, pm me

Last edited by cereal83; 06-01-2006 at 01:08 PM.
 
Old 06-01-2006, 02:14 PM   #13
RHTopics
Member
 
Registered: May 2006
Posts: 45

Rep: Reputation: 3
nykey, I am glad you found "partimage" to be useful. I will have to check out "SystemRescueCD". It sounds like a good tool to add to the software toolbox.

In your post you state; "But those who make a image of a system lighter than mine have good chances of getting the image on a CD with .gz compression.".

One of the options with "partimage" is to have it split your image copy into multiple files. On the second screen, there is an option labeled "Image split mode" that has 3 possible options. By selecting the second option labeled "Into files whose size is....... [2037] MiB" and then changing the 2037 to something like 700, it will cause "partimage" to create multiple files of your image copy. The first file will have the extension of ".000", the second file will have the extension of ".001", and so forth for each file for the image copy.

I chose to create files with a size of 690 just to make sure they could be burned to a CD without problems.

A couple of days ago, I used "partimage" to make image copies of four partitions on a drive that appeared to be failing. Then using "k3b", I burned the image copies to CDs. My root and /home partition spanned multiple CDs. I used the Gzip level of compression.

After installing a replacement hard drive and then creating partitions to be the same size as the partitions from the old drive, I used "partimage" to restore the image copies into the replacement drive using the CDs. For image copies spanning multiple CDs, you provide the full name of the first file of the spanned set (i.e. /mnt/cdrom/image_copy_hda1_root.img.000). "partimage" will prompt you for the subsequent files of the spanned set.

PDock, the restore in "partimage" worked just fine for me with no apparent problems.

The version of "partimage" I used was (Partition Image 0.6.4), so if you are using a different version, your screens may look different.

Last edited by RHTopics; 06-01-2006 at 02:20 PM.
 
Old 06-01-2006, 02:21 PM   #14
nykey
Member
 
Registered: Nov 2003
Posts: 360

Original Poster
Rep: Reputation: 30
Go ahead an try it, it's not very different from partimage, actually I think it is partimage on a booting CD so you don't have to use other distro LIVE CD's. And yes it has the option to split the images too but what I wanted to say is that one could have it only on 1 CD depends on all software installed (amount of data backed up) and compression level.
 
Old 06-01-2006, 02:39 PM   #15
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Rep: Reputation: 63
Good thread! I've been looking for a good topic on this.

I've been using 'drive image' from powerquest now symantec for years. I used norton/symantec ghost to for more forensic copies.

My problem that I've had is coming over to linux, neither drive image or ghost do a nice job on reiser fs w/compression. So in an effort to keep my back up's true copies, but in a highly compressed format, I've been using ext3 file system.

Last edited by Old_Fogie; 06-09-2006 at 12:38 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backing up/restoring LILO tntcoder Linux - General 3 05-27-2006 04:00 PM
LXer: Backing Up and Restoring Using the cpio Command in Linux and Unix LXer Syndicated Linux News 0 05-26-2006 01:33 PM
Backing Up / Restoring Arrowx7 Linux - Software 6 09-20-2005 08:49 PM
Backing up a Slackware server technician Slackware 3 03-09-2005 01:50 PM
backing up and restoring linux graystarr Linux - General 8 01-06-2002 10:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:07 AM.

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