SlackwareThis 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.
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.
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?
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.
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.
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.
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!
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!
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
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.
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 - 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.