LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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-20-2003, 07:57 PM   #1
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 46
Ghost-like method for system backup?


Hi Slackers,

I got my system setup exactly how I wanted it right now, and this journey took quite some time. I was wondering whether it's possible to backup my whole Slackware system in its current state onto an image file or something similar (like I can do using Ghost for backing up/restoring FAT32 partitions?).

However, I did consider some things... Linux treats the system as one big filesystem (/dev/* for devices... etc, I hope you get my point), does this mean that if I created a backup file (something like my Ghost example above... if there is such method on Linux), it will only work if I restored it in a system that is EXACTLY the same as the source? eg.:

My source system has Linux installed in hda.

I have another identical computer but this time I want to restore the backup in hdb... and it should be working.

I don't mind having to relink symlinks/shortcuts etc., but at the very least the system should be able to boot successfully in order to let me do this.

Is this possible? Or should I learn programming more and come up with some simplified distro-ish like installer?
 
Old 05-20-2003, 08:37 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
man dd ;)

Since dd produces identical twins (that is,
you get all empty sectors, too) you could pipe
it through gzip ...

something like
dd if=/dev/hda1 | gzip > my_disk_image.gz

The "normal" approach would have been
to do something like:
dd if=/dev/cdrom of=/tmp/slack-9.0.iso

Cheers,
Tink
 
Old 05-20-2003, 09:49 PM   #3
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Original Poster
Rep: Reputation: 46
Where would I be without this guy...

Thanks so much Tinkster! I'll read more on dd when I get back home... In Windowsland now (at work).
 
Old 05-20-2003, 11:35 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Most likely where you are anyway mate :}

Hope it works for you that way...

Cheers,
Tink

P.S.: I really like your footer (and your attitude, for that matter!) :)
 
Old 05-21-2003, 08:21 AM   #5
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Original Poster
Rep: Reputation: 46
I did a man on dd... however from (my newbiesque) understanding it seems like dd is more of a data backup type of tool.

I understand the system is still consisting of files, but will dd preserve its properties... ie. executables can still be ran as usual by users with proper permissions?

Another thing, can we also dd swap spaces? Yet another query is how do I extract the gzip file created because I intend to use it as a Quick Restore cd (or a rescue cd, if you prefer) ie. the target PC wouldn't any partitions prepared, not to mention Linux and the tar app installed.

Perhaps I could summarize my needs as follows:

1) Need to backup the current state of my installation. System files MUST be intact, /home partition is not too important.
2) To store the backup file on a bootable media, most likely a CD-ROM.
3) The restoration should be as easy as possible, perhaps at most asking for which partition/disk should be set as the target.

As for making the target bootable, I think I'll manage by using fdisk.

As for making the CD bootable, from my experience compiling the kernel, I'd assume that I have to compile a kernel with the minimal requirement to boot my PC (if I were to make the CD as some sort of a mini-distro, I should compile a kernel with as many filesystem and device support as possible), and somehow make the CD boot with that mini-kernel.

It seems that its yet another round of manual reading... however, I'd appreciate any tips that you can give.
 
Old 05-21-2003, 03:32 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Quote:
I did a man on dd... however from (my newbiesque) understanding it seems like dd is more of a data backup type of tool.
That's a misunderstanding, then...

dd takes a byte (or block of bytes, you set
the options) from stdin and puts in to stdout
by default ... you can, however, using "if="
and "of=", tell it to do something different...

As you see in my example, I take if=/dev/hda1,
which means that it will read EVERY single byte
of the raw device, which also means that it
will preserve whatever it finds there... dd doesn't
know about filesystems in this case, and whether
it's ext2, ext3 or reiser doesn't mean anything for
the process... ;)

Quote:
Yet another query is how do I extract the gzip file created because
zcat my_disk_image.gz | dd of=/dev/hda1

If the partition scheme (as well as the swapspace) is
of concern you can just do if=/dev/hda, which will then
clone the entire drive, partition table, partitions and all :}

The only disadvantage is that it doesn't query sizes ...
Thus, if your cloned HDD is smaller you'll lose data,
if it's bigger you'll waste space ...

The work-around would be not to dd the raw-devices
but rather mount-points...

The probably EASIEST way would be using partimage.

Cheers,
Tink
 
Old 05-21-2003, 04:09 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Tinkster is right - you would be much better of with partimage:
http://www.partimage.org
 
Old 05-21-2003, 04:22 PM   #8
destry
Member
 
Registered: May 2003
Location: Texas
Distribution: Win2000, Lindows, Xandros, Mandrake?
Posts: 40

Rep: Reputation: 15
azmeen, Ghost backup?

Azmeen, you can do a disaster backup with Ghost 2003. This is the dope, install Ghost 2003 on a windows box to make the Ghost Boot Disks. Shut down your Linux machine and reboot with the two PC dos boot disks you made from Ghost on the Windows machine. At the Ghost 2003 backup screen choose options and do the following, under Span/Crc select Spanning and Auto Name, under Fat32/64 choose Fat 32, under misc. leave blank, under image/tape select image Disk (the bottom selection which images to unpartitioned space also-important!) under HDD Acess, leave blank, under security, leave blank or select an option. Click on "save settings" and then accept. At the main menu select image from disk to CDrs and follow the on screen instructions. It works, it will take about 45 to 1.5 hrs and take 6-8 cds.

destry
 
Old 05-21-2003, 04:28 PM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
That means having (leagally) a ghost licence AND a windows licence!

Partimage is opensource
 
Old 05-21-2003, 04:40 PM   #10
destry
Member
 
Registered: May 2003
Location: Texas
Distribution: Win2000, Lindows, Xandros, Mandrake?
Posts: 40

Rep: Reputation: 15
david-ross, Ghost backup

David, thats right, one would need a copy of Ghost 2003 or have access to some one with the floppies. Many of the people we know are coming from a long experience with M$ and are like us, with mountains of M$ software. One of ours was Ghost 2000, 2001, 2003, and of these only 2003 will accurately do a byte by byte image of The Linux partition which would include the swap files!

Thanks, destry
 
Old 05-21-2003, 04:57 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
I wouldn't have thought that cloning tools
are very commonly used by "privates" ;) ...

How much is Ghost, anyway? In US$?

Cheers,
Tink
 
Old 05-21-2003, 05:08 PM   #12
destry
Member
 
Registered: May 2003
Location: Texas
Distribution: Win2000, Lindows, Xandros, Mandrake?
Posts: 40

Rep: Reputation: 15
Tinkster-Ghost backup

Tinkster, I cant remember what we paid for Ghost 2003, however Symantec offers upgrades at a discount for exeisting products and I think it was about $49 us.

Remember if you run M$ you need all the backup you can get! I know how we felt about mabey loosing our hard won work getting Linux up and running. We didnt want to lose it and thats how we found out Ghost would work. At first Symantec said it would work, but that didnt make sense because it does a byte by byte copy of the harddrive. The real breakthrough came from a Xandros tech who told us that most Linux partitions are actually three partitions. Thats when we looked at the options menu and found the option telling the program to image all partitions of the disk as one image!

destry
 
Old 05-21-2003, 05:26 PM   #13
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,171

Rep: Reputation: 51
here's what i do sometimes.
i got the partition i want to backup or copy with dd, and
dd if=dev/zero of=full
when it fills up, sync
delete the file full then
cat or dd, depends on the mood
dd if=/dev/hda1 | gzip -9 > hda1.dd.gz
then to restore
gzip -cd hda1.dd.gz > /dev/hda1
but if i want to copy files from that image, i
can gzip -cd hda1.dd.gz > hda1.dd
my gzip on handles 2 gig files.
mount -o loop hda1.dd /mnt/image
then i can copy files out of /mnt/image if i want

if you have a 40 gig drive and you're moving to a
a 60 gig, you can still dd if=/dev/hda of=/dev/hdX bs=1M
then when it's done you just have 20 gigs free at the end
and you can add a partition. I've done this hundreds of times.
i found the bs=1M is much faster than the default. I tested that
2 years ago. i don't know if it was the machine or it's true in
general.
 
Old 05-21-2003, 05:40 PM   #14
destry
Member
 
Registered: May 2003
Location: Texas
Distribution: Win2000, Lindows, Xandros, Mandrake?
Posts: 40

Rep: Reputation: 15
whansard-ghost type backup

Dear whansard, way to go. If I tried that right now no telling what I would get. The command line is still a little foreign to me right now except for apt-get and a few other commands.

The Ghost thing will give you a clone of your harddrive right down to the screen savers, email and all data on your disk. As long as your drive is the same size or larger you can put the new formatted harddrive in and boot the Ghost cds and when its finished youve got mail!

destry
 
Old 05-21-2003, 05:45 PM   #15
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
2 quick points/questions from partimage.org

destry - does ghost support compression & network backup?
Quote:
Partition Image is a Linux/UNIX utility which saves partitions in many formats (see below) to an image file. The image file can be compressed in the GZIP/BZIP2 formats to save disk space, and split into multiple files to be copied on removable floppies (ZIP for example), .... The partition can be saved across the network since version 0.6.0
Reasons for not using dd
Quote:
Partition Image will only copy data from the used portions of the partition. For speed and efficiency, free blocks are not written to the image file. This is unlike the 'dd' command, which also copies empty blocks. Partition Image also works for large, very full partitions. For example, a full 1 GB partition can be compressed with gzip down to 400MB.
ok - Just for good measure I'll trow in a third
http://www.opensource.org/licenses/gpl-license.html
 
  


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
What is your backup method? ChillyWillie Mandriva 4 07-26-2005 02:20 PM
A backup software like windows ghost alyks Linux - Software 7 10-28-2004 02:40 PM
using tar as a backup method tarax Linux - Newbie 3 06-22-2004 04:25 PM
Norton Ghost Backup Success chris319 Linux - Software 0 08-04-2003 01:39 PM
best backup method slightcrazed Linux - General 9 06-26-2003 03:23 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration