Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
05-31-2006, 02:05 PM
|
#1
|
Member
Registered: Nov 2003
Posts: 360
Rep:
|
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.
|
|
|
05-31-2006, 02:18 PM
|
#2
|
Member
Registered: Jul 2004
Location: Lisbon
Distribution: Slackware
Posts: 39
Rep:
|
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!
|
|
|
05-31-2006, 02:34 PM
|
#3
|
Senior Member
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191
Rep:
|
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.
|
|
|
05-31-2006, 02:43 PM
|
#4
|
Member
Registered: Nov 2003
Posts: 360
Original Poster
Rep:
|
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".
|
|
|
05-31-2006, 03:19 PM
|
#5
|
Member
Registered: May 2006
Posts: 45
Rep:
|
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.
|
|
|
05-31-2006, 03:23 PM
|
#6
|
Member
Registered: Nov 2003
Posts: 360
Original Poster
Rep:
|
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.
|
|
|
05-31-2006, 05:40 PM
|
#7
|
Senior Member
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191
Rep:
|
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
|
|
|
05-31-2006, 11:43 PM
|
#8
|
Member
Registered: Nov 2003
Posts: 360
Original Poster
Rep:
|
[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.
|
|
|
06-01-2006, 02:13 AM
|
#9
|
Senior Member
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191
Rep:
|
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
|
|
|
06-01-2006, 03:50 AM
|
#10
|
Member
Registered: Nov 2003
Posts: 360
Original Poster
Rep:
|
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.
|
|
|
06-01-2006, 05:17 AM
|
#11
|
Member
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189
Rep:
|
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
|
|
|
06-01-2006, 01:06 PM
|
#12
|
Member
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479
Rep:
|
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.
|
|
|
06-01-2006, 02:14 PM
|
#13
|
Member
Registered: May 2006
Posts: 45
Rep:
|
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.
|
|
|
06-01-2006, 02:21 PM
|
#14
|
Member
Registered: Nov 2003
Posts: 360
Original Poster
Rep:
|
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.
|
|
|
06-01-2006, 02:39 PM
|
#15
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 03:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|