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.

dd can do it, but, depending on cpu speed, it could take a looooonnnngggg time. If you interrupt dd, it could damage your OS and make it non-bootable.
Investigate DAR. Use it to make a full backup of your OS, then restore it to a new partition.
There is also partimage. The drawback is that the partitions must be the same size, or partimage will balk.
Dar doesn't care about partition sizes. It can make a compressed backup (each file compressed individually, contrary to tar). It even gives you the option to include a static version of itself with to backup, to ease the restoration process.

I'm not sure if this is what you're looking for or not, but Mondo Rescue is a free backup program for Linux. There's also Partimage which can backup partitions and compress them. Partimage can be found on the System Rescue CD, a bootable CD with lots of nifty utilities for rescuing/restoring/etc. systems (as per the name). Hope that helps!

I am a roving technician. I primarily service Windows systems. I would love to be able to take a laptop with me in which I can:

1. Hook up the hard drive to be backed up to the laptop via a USB enclosure.

2. Boot up into Linux (preferably a Live CD, but with help I'd be willing to set up Linux on a partition. Right now the laptop is WinXP Pro.)

3. Back up the USB-connected drive to an image on the primary hd. The image would contain the entire HD including partition and MBR info.

I had thought I could do this via dd, but I understand that might not be the best. Of course, the WINDOWS solution, is Ghost, but that requires a purchase for every customer. I'm hoping to not have to do that.

I haven't tried this with a usb drive yet but if it can be done with usb drive, this is how you might proceed... Boot up with a linux livecd such as systemrescue cd. You will need a partition on your laptop which can be written to ( vfat or ext3 ) .

You can use dd or sfdisk to save and restore the MBR including the partition table. That means you don't have to worry about getting the partition sizes right.
For example ....
laptop system is loaded on /dev/hda1 and is type vfat
usb drive partition is detected as /dev/sda1

Mount the partition where the images are going to be saved to.
mount /dev/hda1 /mnt/images -t vfat

If you have an Extended partition, sfdisk may give you an error when you try to restore. In this case, it's better to use dd to backup and restore the partition table.
dd if=/dev/sda of=/mnt/images/partfile bs=512 count=1

Run the command: partimage
save the partition /dev/sda1 to an image on /mnt/images/win

To restore the image which automatically gets an extension added to the file name.
So in this case , it would be win.000
Bootup with the livecd and mount the partition where the image is stored ...
mount /dev/hda1 /mnt/images -t vfat

Wow. Not too bad, but I see I can't use one utility to save everything -- mbr, content, partinfo -- like Ghost, right?

Are all those utilities you mentioned common to every distro? I was thinking about using Knoppix, but it seems that's a little heavy for what I need. I just need something that can detect USB drivers and drops to a command prompt.

Partimage is on a lot of livecds and I enjoy feather, systemrescue, knoppix and just about any other distro. I think knoppix has the inside track on detecting hardware. You don't have to boot to the full blown graphical mode.
I usually boot into the command line like this ... knoppix26 2 but you may want to run the command: dmesg to see if the usb drive is detected and what it's called like maybe /dev/sda or similar.

Partimage does work to save and restore ntfs partitions. You can save and restore individual partitions but then you will need to create the partition using something like fdisk or qtparted. The downside to creating the partition is that it needs to be the same size or larger than the original partition. ( much easier to make it larger than try get the exact size ) . If you restore to a slightly larger partition, then you will need to use the correct tools to resize the filesystem to fit the partition. That is no big deal INHO
For ntfs patitions, that would be ntfsresize
For example, on a system where it's on /dev/hda I would use the command:
ntfsresize /dev/hda

Partimage is not quite to the point of automaitcally making an image of several partitions but you can use the proceedure which I mentioned before to save and restore the MBR and partition table.
Then you can use partimage to save individual partitions and to restore individual partitions.
You can put those jobs into a couple of scripts which will walk through the process one partition at a time thus you can to the entire hard drive. One script for saving things and one script for restoring but unless things are always the same, you will need to edit the scripts accordingly....
For example, here is an operation to save and restore a drive /dev/sda which has three partitions on it.

If you are going to clone an NTFS partition, you may want to run defrag and scandisk first.

Bootup with the rescue cd and run the save script to save the partitions to images.

Mount the partition where the images are going to be saved to.
mount /dev/hda1 /mnt/images -t vfat