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.

(2) You can later restore selectively say only sda1. dd copies the entire partition including the boot sector. Therefore you Lilo will be restored as it is inside the sector 0 of hda1.

(3) When you restore sda1 you swap the devices from the input with the output. Thus using your original command it would be changed to

Code:

dd if=/mnt/myexternaldrive/sda1 of=/dev/sda1 bs=4k

(4)dd is just the carbon paper. You should have either the source exactly the same size as the target or the target bigger than the source if the whole disk is cloned. If you clone a larger disk into a smaller one, even if you have one byte, the big disk partition table will be cloned into the small disk, thereby making it an outcast. No operating system would want to read a disk that has a partition table larger than the physical size of the disk. You are then screwed if no operating system dares to read it.

For restoring a partition you need both partitions identical in size or the filing index will be messed up.

When a smaller disk is cloned into a large disk the extra capacity just become unallocated empty space which can be incoporated into existing partitions by resizing software like Gparted or Parted Magic.

(5) I have not met a Linux that has not got dd. It is nearly your God given right when using a Linux.

(6) When you restore a disk you write the whole disk including the partition table. Therefore there is no need to partition the target disk. However, as a word of caution, it pays to create just a partition in the target so that you can check it is using the correct geometry of 255 heads and 63 sectors, otherwise most raw disks can be cloned straight from a purchase.

Thnx a lot for the information... Now i can happily get on with messing with my distro. Lol.

just 1 last question:

If i simply create a large enough Ext2 partition on the my external drive and the use dd to copy the entire laptop hardisk in a xyz.img file, all of the above things would still work. I think ext2 or ext3 does not have problems with large file sizes like 60 GB...???

Okay.. as suggest in the above post i am running an experiment...lol with a 10 GB partition containing windows XP.
This is what i did:

# dd if=/dev/sda1 of=/mnt/Temp/Win_c_Backup.img bs=4k
where /mnt/Temp is a 60 GB partition on my external USB Hardisk. The copying is still in progress but its tooooooo slow. Like it has taken already more than 10 mins and is till copying it. Just to verify i opened the drive and looked at it, and yes there is a file called win_c_backuo.img there but so far its size is only 2.8 GB after 10 mins... I had thought the copying would go may be a bit faster than that. Before , i tried a 5 GB partition and that time copying took only 5-8 mins ...
Any ideas on about how to speed things up..

Would it help if i increase the size mentioned in bs parameter???

Edited
****************
I read up on dd and i think that the bs parameter specifies the number of bytes to written to hard disk with a single system call. So i think here with the command that i have used , it meas 10GB /4K number of system calls. May be that is the reason for slow speed.