PDA

View Full Version : Disk Image Question


bschultz
10th April 2007, 23:48
I need some advice. I have 1 Linux server running Etch, and I have 2 Windows laptops. All of these machines are in my house. I am looking for a Linux disk-imaging solution for the server. I've looked over the How-To section for backups, and none of them fit my needs. The all seem to require something out of the second machine. But, I don't want to run an SSH server on my Windows machine (because Windows stinks, and isn't secure!). So what are my options?

Can I create an image on my server and store it on my server without the need for a second machine? Can I create the image and use TCP/IP to send it to my Windows laptop? Can I just create a "server" and a "client" (using Systemimager) on two separate partitions of the Linux machine's hard drive.

I do have a spare Firewire drive sitting around...can I do a software raid on an internal drive and an external Firewire drive?

What would you all suggest?

Thanks.

Brian

falko
11th April 2007, 17:54
Can I create an image on my server and store it on my server without the need for a second machine?Yes, if you have a second HDD (for example an USB drive, Firewire drive, etc.). You can create an image of all neede partitions with dd on the external HDD like this:
dd if=/dev/sda1 of=/directory/where/external_drive_is_mounted/image.dd(assuming you want to back up /dev/sda1.)
To restore the image, do it like this:

dd if=/directory/where/external_drive_is_mounted/image.dd of=/dev/sda1If it is your system partition that you want to restore, you must do it from a Live-CD.
Today I've written a tutorial about using LVM snapshots (it also makes use of dd), so if you use LVM, this might be interesting. I'll publish it in a few days.

Can I create the image and use TCP/IP to send it to my Windows laptop?Yes, but only if you create the image of one partition on another partition.
Can I just create a "server" and a "client" (using Systemimager) on two separate partitions of the Linux machine's hard drive.No, that doesn't work.

I do have a spare Firewire drive sitting around...can I do a software raid on an internal drive and an external Firewire drive?

I've never tried that. :confused:

bschultz
11th April 2007, 18:07
If I use disk dump, do I have to worry about any files changing while the dump is happening corrupting the backup copy? I'd like this to be done via a cron job daily or weekly and store the last several backups and rotate out the oldest one...but can that be done (the backup snapshot taken) on the system partition while the machine is in use? I realize that for a restore, I'd need to shut it down and boot into a system restore disk.

I actually reinstalled Etch last night and did the install with LVM on just in case I needed it:) Good timing, I guess since you did a How-To on it!

Thanks, Falko

sjau
11th April 2007, 20:15
Sorry for hijacking this thread:

Can you make images of a windows partition with dd?

falko
12th April 2007, 18:00
If I use disk dump, do I have to worry about any files changing while the dump is happening corrupting the backup copy?
Yes, that would be a problem. But you can avoid it with LVM snapshots (I'll publish the tutorial in a few days). :)

falko
12th April 2007, 18:01
Sorry for hijacking this thread:

Can you make images of a windows partition with dd?
I'm not sure. I think creating the image might not be a problem, but restoring it if the partition is an NTFS partition and you don't use ntfs-3g. But I've never tried this.

bschultz
12th April 2007, 18:05
Sorry for hijacking this thread:

Can you make images of a windows partition with dd?


I've always used DriveImage XML for Windows. Works quite well.

bschultz
16th April 2007, 23:39
Falko,

I'm getting an error message on step 3, page 2 of the How-To.


lvcreate -L10G -s -n rootsnapshot /dev/mail/root
and here's the error message
Insufficient free extents (1858) in volume group mail: 2560 required

The second drive is a 40gig USB drive that's empty right now. Any ideas?

Thanks.

Brian

falko
17th April 2007, 12:58
Did you add that drive to the volume group?
What are the outputs of pvscan and vgscan?

bschultz
17th April 2007, 14:47
I found the problem...


mail:~# pvscan
PV /dev/hda5 VG mail lvm2 [111.55 GB / 0 free]
PV /dev/sde1 VG mail lvm2 [37.26 GB / 7.26 GB free]
Total: 2 [148.80 GB] / in use: 2 [148.80 GB] / in no VG: 0 [0 ]
mail:~# vgscan
Reading all physical volumes. This may take a while...
Found volume group "mail" using metadata type lvm2
mail:~#


Now the questions is, what is on sde1? The drive (I thought) was formatted prior to me following the how-to. I'll reformat, and try again. Thanks Falko!

bschultz
17th April 2007, 19:35
I tried to format the drive...


mail:~# mkfs -t ext3 /dev/sde1
mke2fs 1.40-WIP (14-Nov-2006)
/dev/sde1 is apparently in use by the system; will not make a filesystem here!


...but the system won't let me. Am I better served to pull the drive (since it's USB) and format it on a separate machine, and then plug it back into the server?

sjau
18th April 2007, 08:20
You have to unmount it first:


umount /dev/sde1

bschultz
19th April 2007, 04:52
I had already done that...still said it was in use by the system. I'm gonna pull the drive and format it in Windows...and try again. I'll post the results.

Brian

falko
19th April 2007, 14:31
You can try to kill all processes that use /dev/sde1 by running
fuser -k /path/to/mount_pointAfterwards you should be able to unmount the device.
If that doesn't work, you can use the GParted LiveCD: http://www.howtoforge.com/partitioning_with_gparted