Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Let's say I have my Linux setup all nice and perfect. All the right packages, all the right kernel patches and modules, etc. Let's say I wanted to create a snapshot of how my whole OS was at the time in case I want to restore or maybe migrate this to another computer. What would I have to do. I want to store this on an external HD.
Here's my understanding so far. I want to make sure I'm not missing anything.
1. (This step really isn't necessary because the Step 2 would include the vmlinuz file, however I seek understanding) Copy my kernel /boot/vmlinuz-huge-smp-2.6.29.6-smp to my external HD. Would I need the /boot/config-huge-smp-2.6.29.6-smp and the /boot/System.map-huge-smp-2.6.29.6-smp. What are these for exactly? Does the config one just have all my kernel parameters in case I want to recompile the kernel later? Or does the bootloader use the config file to start the kernel image with those config options? What about the system.map. Is it just a table of my partitions so the bootloader knows which partition is the master or boot partition? In my lilo.conf there's only an entry for vmlinuz not the other two. How and where are these two files used? Are these necessary?
2. Run this
Code:
tar -cvzf -X /mnt /proc /sys /tmp complete-backup.tgz /
I would save the big complete-backup.tgz file to my external HD. That would be it?
Then if I wanted to install to another computer or a fresh machine I'd do once logged in as root.
1. Run this
Code:
tar -xvf complete-backup.tgz /
2. Run this
Code:
mkdir /{mnt,proc,sys,tmp}
mount --bind /dev/ /dev
mount -t proc proc /proc
Do I need to do anything special to the sys and tmp root folders?
Would that work?
Would this be considering making a ghost image? Is there a more efficient or a quicker solution?
Let's say I have my Linux setup all nice and perfect. All the right packages, all the right kernel patches and modules, etc. Let's say I wanted to create a snapshot of how my whole OS was at the time in case I want to restore or maybe migrate this to another computer. What would I have to do. I want to store this on an external HD.
Here's my understanding so far. I want to make sure I'm not missing anything.
1. (This step really isn't necessary because the Step 2 would include the vmlinuz file, however I seek understanding) Copy my kernel /boot/vmlinuz-huge-smp-2.6.29.6-smp to my external HD. Would I need the /boot/config-huge-smp-2.6.29.6-smp and the /boot/System.map-huge-smp-2.6.29.6-smp. What are these for exactly? Does the config one just have all my kernel parameters in case I want to recompile the kernel later? Or does the bootloader use the config file to start the kernel image with those config options? What about the system.map. Is it just a table of my partitions so the bootloader knows which partition is the master or boot partition? In my lilo.conf there's only an entry for vmlinuz not the other two. How and where are these two files used? Are these necessary?
2. Run this
Code:
tar -cvzf -X /mnt /proc /sys /tmp complete-backup.tgz /
I would save the big complete-backup.tgz file to my external HD. That would be it?
Then if I wanted to install to another computer or a fresh machine I'd do once logged in as root.
1. Run this
Code:
tar -xvf complete-backup.tgz /
2. Run this
Code:
mkdir /{mnt,proc,sys,tmp}
mount --bind /dev/ /dev
mount -t proc proc /proc
Do I need to do anything special to the sys and tmp root folders?
Would that work?
Would this be considering making a ghost image? Is there a more efficient or a quicker solution?
First, it wouldn't work. Look at how you'd do the restore:
Code:
tar -xvf complete-backup.tgz /
and think about it. You'll overwrite a LOT of the system libraries....like the ones that tar is using, libc, etc. Once they get partially overwritten, the process(es) using them will die...leaving you with NO WAY to continue.
This has been covered on here many times. Mondoarchive, mkcdrec, and systemimager are three pieces of software, designed specifically to do this. Leave you with bootable, 'snapshots' of an entire system, ready to be put onto other 'blank' systems. Mondoarchive is especially flexible, letting you boot from CD, DVD, or over net from an ISO image. Store it wherever you want.
Yes TB0ne you're right, didn't think about that. I'd have to boot up a Live CD and copy the contents to say /mnt/sda3 instead of /.
I found this on ghosting a drive http://www.linuxweblog.com/blogs/san...drive-using-dd
However on the last statement about zero'ing out unused blocks. That last dd command stated, won't that erase everything in the partition? Or just the unused blocks? What kind of output file(of) would I use if I had a partition /dev/sda3?
That will create a big file called delete.me The dd command will eventually fail because the disk has run out of space because all the free space has been allocated to the file delete.me, which is fill of zeros.
The second part of that command then removes the file delete.me which frees up space on the filesystem, but leaves the now unused parts of your disk filled with zeros, which are easily compressible.
[Pointless aside, 5% of your disk space may still be full of random junk, because of the space reserved for root, but it's a start]
Everything (the backup and the restore) needs to be done from a liveCD. But it works fine. Personally I don't bother with tar, but that just personal preference - I just "cp -a ..."
Make sure you have partitions and filesystems in place on the target.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.