Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 05-22-2004, 03:23 PM   #1
Registered: May 2004
Location: Atlanta, GA
Distribution: Slackware Current
Posts: 54

Rep: Reputation: 15
How to Back Up the Kernel and Files?

Hello All,

I just upgraded yesterday from 9.1 to Current with few problems, however, now my kernel image and other related files are too big to fit on a floppy. Makebootdisk won't work because the files are just too big. And I'm too inexperienced to start paring down the kernel...

What can I do to get a back up in place? Is there some way to put everything on two floppies or is there a way to make a back up boot disk on a cd (I know, a very newbie question..but that's me). I'm running Slack with NO Windows OS.

Thanks for your help. I haven't been able to find much information on the subject.

Old 05-23-2004, 03:15 AM   #2
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,881

Rep: Reputation: 564Reputation: 564Reputation: 564Reputation: 564Reputation: 564Reputation: 564
One way to do it would be to create a small FAT partition. Copy your new kernel there along with loadlin.exe and linux.bat (from the loadlin pkg). Then with a bootable DOS floppy you could run loadlin from there to bott Linux.
Or , maybe better still- you are probably using lilo to boot from MBR. You can edit your /etc/lilo.conf file. Change the line
This changes the install location of lilo to the floppy drive. Now, rerun lilo and it will install to the floppy. make sure it works, then re-edit lilo.conf and change the line back to the way it was. Run lilo again to reinstall to MBR(just to be sure). Now you can boot with lilo, either from MBR or from floppy.
Old 05-23-2004, 06:47 AM   #3
Registered: Mar 2004
Location: Georgia
Distribution: SlackWare 10.1+, FreeBSD 4.4-5.2, Amiga 1.3,2.1,3.1, Windors XP Pro (makes a fair answering machine)
Posts: 287

Rep: Reputation: 30
Hello Lucinda !
I am from Snellville and welcome aboard!
If you are not using a floppy to boot with and just want a rescue disk the slackware disk 2 serves the purpose well. There are also many other "live" linux cds available to suit this purpose also.

Also on this note the bare.i kernel found on slack cd 1 and slack cd 2 is small enough to make a floppy from for rescue purposes.

If you are just starting with a fresh install of slack I would suggest the above or better yet do a reinstall and put lilo on the boot part of the harddrive and not in the MBR.

If you are new to unix flavor OSs I would do a bit of reading on using stable (9.1) vs. current (may be unstable under development) distros. You can run swaret with 9.1 set in the conf fill and it will update the stable 9.1 install.
If you desire a GUI I would suggest dropline-gnome
It is a gnome flavor GUI made for slack. Very sleek and fast with enhanced utilities for slack itself.
Old 05-23-2004, 08:16 AM   #4
Senior Member
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Do you have a cd burner? If so, do this..

mkrescue --iso
cdrecord -scanbus
cdrecord -v dev=0,0,0 rescue.iso

(dev=0,0,0 is the output you got from 'cdrecord -scanbus' where your cd-r is....)

Now you have a nifty boot cd..... mkrescue is from lilo... Install it if it's not already...

Or if you have k3b or a GUI burning program that does images, just do this:

mkrescue --iso

And then open up your favorite burning program and burn that image to a disk. It will be in your user's directory.... It's 100 times faster than a boot floppy and your kernel image can be up to 700mb....

Last edited by jong357; 05-23-2004 at 08:23 AM.
Old 05-23-2004, 09:47 PM   #5
Registered: May 2004
Location: Atlanta, GA
Distribution: Slackware Current
Posts: 54

Original Poster
Rep: Reputation: 15
Hey Guys,

Thanks for the information. (And it's great to hear from someone in the Atlanta area! I live in the midtown area, close to all the action!).

Your suggestions are very helpful, but I have a few questions for you veterans.

1) Is it "bad" to have LILO booting from the MBR? I didn't think it would be that bad considering that I have no other OS on my machine. Should I try to change it to get to load off my hda3 partition? How can I do that without wiping everything out and starting over again. I've been using LInux now for three weeks and I'm just to the point where I've got just about everything I need set up the way I like

2) I managed to create a rescue disk with "mkrescue", but is this as good as having the kernel itself on a disk? Is there any way of using a "dd" type command to write the kernel image to a cd rather than a floppy? For some reason, I feel "safer" with the kernel image backed up somewhere externally, but maybe it doesn't really matter....

3) I can boot from the rescue disk, but I noticed that my devices somehow are "reassigned". That is, my microdrive is suddenly on sdb1 (is normally sda1) and my Iomega external hard drive is at sda instead of sdb3. This is quite annoying because in an emergency situation I'd want to get to those devices. Why is Slack doing that? In a worst-case scenario, would I just edit fstab, re-assign the devices, etc. to get them working?

4) I have a few live linux CD's lying around (i.e. Knoppix, Slack, etc). I suppose I could just boot off those if I had to, but would I be able to access my system as root? It seems that I would be recognized as root for the "system" on the cd...but how do I access my system as root...not just root for the cd.

(I hope I'm making sense in the post....please forgive my "newbiness" if I'm not),

Thanks again for your help!

Old 05-24-2004, 05:52 AM   #6
Registered: Mar 2004
Location: Georgia
Distribution: SlackWare 10.1+, FreeBSD 4.4-5.2, Amiga 1.3,2.1,3.1, Windors XP Pro (makes a fair answering machine)
Posts: 287

Rep: Reputation: 30
A noteworthy tip: If space allows on your external harddrive or another harddrive on your system make a full complete backup... Believe me in comes in realllll handy.
Since I started using Slack 2 months ago I have 1> installed and reinstalled twice on the first box I used slack on, 2> disassemblied that box 3> moved slack from the original harddrive and spread it across 4 drives 4> reinstalled portions a number of times uncountable 5> needed the live disk 2 to save the system oh about a dozen times. 6> and reconfigured everything well all the time.... 7> change kernels every other week

If you use a complete backup and you keep it updated after you make changes then a reinstall is real simple if you have to do one. Also this backup on a bootable partition makes an excellent rescue section should the need arise... It saved me countless hours of configuring due to a funky harddrive...

Now as far a lilo and the MBR I would say it is a matter of taste. I have mine on the / drive. Of course that makes a requirement for a bootdisk to use the rescue section of my harddrive in the event of a complete / crash. But it allows for repartitioning the drive should I wish to change the drive partitions with utilitiy like FIPS and maintain bootablity of /. If lilo was in the MBR it could be overwritten during the FIPS action.
And I never really liked boot managers in the MBR... Less risky to update or change to another version if it is not in the MBR. Anytime you mess with the MBR of a disk you run the risk of losing all the the data a disk has.

Using 'dd' to build a custom disk is very possible... This custom disk would fix your other issues with your devices. The HOWTOs have this covered in many sections. If you installed them they are here in a browser file:///usr/doc/Linux-HOWTOs/INDEX.html

The slackware disk 2 allows you root access to any devices. There is a plus to using a rescue/bootdisk with a full type kernel or keeping a full unedited kernel available to boot with. If you add something to your machine you can easily boot with taht full kernel and see how it is seen by the kernel and make the required changes to your own kernel from there. Also if a machine goes funky it will allow you to see if it is a software or hardware issue...

Hope you find some of this helpful....
Old 05-25-2004, 11:24 PM   #7
Registered: May 2004
Location: Atlanta, GA
Distribution: Slackware Current
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks Nicole,

I'd like to ask a few questions regarding your post:

How do you back up your entire system? I have a 120GB external hard drive that I can easily use to back everything up on. I've been reading about back up procedures and I've been getting lots of different opinions! I'm thinking the best thing to do, since I have so much space, is to just make full copies of everything. But I've read that the /proc directory shouldn't be copied, is that correct? Is there any best way for my folders to be organized on my drive to make them easier to recover? Do I just replicate / ?

How do I make my external hard drive bootable? Would I just make my main linux drive (i.e. sdb3) bootable using fdisk?

And I'll have to sift through the boot disk HOW-TO documentation to see how I can get the kernel on the cd. I'm thinking that maybe I could create a boot disk that would function as follows and access /root on my external hard drive in the event of a crash:

A disk containing a kernel which can be booted. The disk can be used to
boot the kernel, which then may load a root file system on another disk.
The kernel on a bootdisk usually must be told where to find its root

Often a bootdisk loads a root filesystem from another diskette, but it is
possible for a bootdisk to be set up to load a hard disk's root
filesystem instead. This is commonly done when testing a new kernel (in
fact, ``make zdisk'' will create such a bootdisk automatically from the
kernel source code).

And I guessI could make another boot cd that also accesses my hda3.

My makerescue cd works for now, but I'd like to get something that's more substantial.


Old 05-26-2004, 01:40 AM   #8
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,881

Rep: Reputation: 564Reputation: 564Reputation: 564Reputation: 564Reputation: 564Reputation: 564
It's super easy to migrate an installation and have it as a complete backup. just mount a formatted partition:
mount /dev/hd?? /mnt/hd
umask 000
mkdir /mnt/hd/proc /mnt/hd/mnt
cp -avx /bin /mnt/hd
etc... Do the above for each directory in /
Do not copy /proc or /mnt
After finishing you can edit lilo.conf, then chroot into the new install or reboot with a floppy and run lilo to make your new install boootable. I guess you could set up rsync so that it would always keep it up to date.
Old 05-26-2004, 06:22 AM   #9
Registered: Mar 2004
Location: Georgia
Distribution: SlackWare 10.1+, FreeBSD 4.4-5.2, Amiga 1.3,2.1,3.1, Windors XP Pro (makes a fair answering machine)
Posts: 287

Rep: Reputation: 30
Here we go....
Primary hard drive
You will need to have your hard drive partitioned hda=1-4 primary parts, 4 should most likely be the swap part... One of these parts should be equal to the whole OS image about 5gb (virgin install of everything) more as needed to suit your additions.

Makin' partitions...
If you have not already done so you will have to format these parts. It is assumed here that you ran cfdisk or fdisk during the install and divided you harddrive in to partitions.

As root we will format the partition

mke2fs /dev/hda# #where hda# is the partition number

You will need to mount this part somewhere.
You must create the mount points for each level before you mount the
partitions at that level.

mkdir /backup [1st level]
mount -t ext2 /dev/hda# /backup #your part number at hda#

you may enter this in your /etc/fstab as
/dev/hda# /backup ext2 rw,dev.sync 1 1

now for the fun part...... Backing up your stuff. If your install is all on one partition it is simple...
cd / && echo cp -a `/bin/ls -1Ab | egrep -v "^backup$|^proc$|^mnt$"` /backup | sh

Or you can use this editted to suit your system....

# cpbackup (beta) - A cp backup utility, 04-17-2004
# Written by Nichole_knc
# This script makes a full backup of the / hd location to a specified hd
# location. Example; / on hda1 copied to / on hdc1
# It was birthed to have a complete / image preserved and used in
# conjunction with a rescue disk (cd or floppy), lilo or gnub as a second
# complete system. There is no user interaction with this. It is for doing
# an unattended backup.

# It is supplied without warranties or guarantees...
# Free to use and abuse.

# NOTE; insure you modifiy this script to bypass any mounted hard drives,
# smb file systems or network file systems you have mapped or mounted.
# Otherwise you backup image will get real big real quick...

# lets do the system first

cp -Rap /bin /backup/
cp -Rap /sbin /backup/
cp -Rap /boot /backup/
cp -Rap /etc /backup/
cp -Rap /lib /backup/
cp -Rap /usr /backup/
cp -Rap /var /backup/
cp -Rap /opt /backup/
cp -Rap /root /backup/
cp -Rap /lost+found /backup/

# userland stuff
# write in your /home stuff here
# make as many lines needed to cover your user dieectories

cp -Rap /home/<users here> /backup/home/

# these should be used with extreme caution
# tmp will normally copy ok.

cp -Rap /tmp /backup/

# copying devices can at times cause problems... i.e. lockup

cp -Rap /dev /backup/

# now the killer and a don't use unless you wish to back up the world
# you can easily see why...
# however if you desire to backup everything you have you could use additional lines here
# you could use this to copy other areas you wish to back up as it would copy everything mounted.
# as in this example

# cp -Rap /mnt/hd2 /backup/
# cp -Rap /mnt /mnt/backup/

Now on the partition we will

mkdir /backup/proc
mkdir /backup/mnt
mkdir /backup/mnt/<other directories>

You can cron this script to run as you wish (daily,weekly,monthly)
for more info man crontab
crontab -e [user]

The usb drive is a whole different game.
You can use the above to copy your system to the usb harddrive but to boot from it requires:
1> you computer can boot from a usb device via the bios
2> you make a boot disk with a initd ram image to mount this usb device and use it as root.

number 1 is the easiest as you can configure lilo to use that drive.
number 2 is a large subject and I will attempt to point you to some HOWTOs where you can gleam some info to cover it and make yourself a boot cd... Also there is info on the net about usb hard drive booting a google should bring these up. On a light note: if you have installed slack and set it so you need a boot disk to start up the computer that is a bit old fashion for a modern machine.
googled results

these assume you installed the HOWTOs locally


Not directly related it gives a full example of building a custom cd with a ram image
see 3.1. Build a Live Linux CDROM

I hope you find all this helpfullllll....
Old 05-26-2004, 06:51 AM   #10
Registered: Mar 2004
Location: Georgia
Distribution: SlackWare 10.1+, FreeBSD 4.4-5.2, Amiga 1.3,2.1,3.1, Windors XP Pro (makes a fair answering machine)
Posts: 287

Rep: Reputation: 30
Once you have done the above stuff you can....

1> assign different lilo.conf boots to the different drives
2> create different bootdisk for rescue purposes
3> have a preserved system image away from your main harddrive (usb drive) that can be removed from you filesystem. This is so you can preserve your hard work done to configure your system and then experiment on it without risk of losein' everything...
If you break it just rescue it....
Linux and the GNU OS are fun to play with. Unlike windors it can be easily recovered.
On the other hand it is not like windors as it will not "ask" you what to do unless you use (-i) for interactive on commands. windors assumes you are stupid and ask "are you sure?" Linux/unix assumes you have some sense about what you are doing and just does it...

Another plus linux does not take all day to install. A minimum install takes about 1/2 hour tops barring any problems or you can plop in a live disk and you are there in about 2 mins..
Windors, well enough said...

explains building kernels.
your machine can have as many kernels as you would like. You can have different kernel images and have them set in lilo to boot for any type of application you wish.
This lends great flexiblility to have a machine with unlimited uses.
i.e. 2 or more machines in a "cluster" as a desktop "supercomputer" or "parallel virtual machine"
(my thingy, see my sig)
custom boots for different hardware configurations that you don't use all the time.
i.e. my usb harddrive is only installed via a different kernel boot and not the kernel I use full time. This way it is not likely to be damaged during regular use and is only mounted on a completely different boot with custom options only for system admin and backup of my complete linux/unix system and machines. (way to much work to lose)

Experiment and see the flexibility of linux....


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
Nuked HDD - Can I get the files back? Nige Linux - General 2 09-11-2005 11:43 PM
What do I do to back up the kernel? Which files do I copy? (Debian kernel 2.4.27-2) GarethC Linux - General 6 08-02-2005 03:49 AM
back up files in mandrake frayed2 Mandriva 4 04-27-2005 10:14 PM
How to get back my --linux-.--- files?? dufferin Slackware 2 06-28-2004 02:30 AM
newbie? back-up OS/files perfect20002 Linux - Software 0 06-19-2003 09:37 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:37 PM.

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