Disk Image Question

Discussion in 'Installation/Configuration' started by bschultz, Apr 10, 2007.

  1. bschultz

    bschultz Member

    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
     
  2. falko

    falko Super Moderator ISPConfig Developer

    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:
    Code:
    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:

    Code:
    dd if=/directory/where/external_drive_is_mounted/image.dd of=/dev/sda1
    If 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.

    Yes, but only if you create the image of one partition on another partition.
    No, that doesn't work.

    I've never tried that. :confused:
     
  3. bschultz

    bschultz Member

    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
     
    Last edited: Apr 11, 2007
  4. sjau

    sjau Local Meanie Moderator

    Sorry for hijacking this thread:

    Can you make images of a windows partition with dd?
     
  5. falko

    falko Super Moderator ISPConfig Developer

    Yes, that would be a problem. But you can avoid it with LVM snapshots (I'll publish the tutorial in a few days). :)
     
  6. falko

    falko Super Moderator ISPConfig Developer

    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.
     
  7. bschultz

    bschultz Member


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

    bschultz Member

    Falko,

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

    Code:
    lvcreate -L10G -s -n rootsnapshot /dev/mail/root 
    and here's the error message
    The second drive is a 40gig USB drive that's empty right now. Any ideas?

    Thanks.

    Brian
     
  9. falko

    falko Super Moderator ISPConfig Developer

    Did you add that drive to the volume group?
    What are the outputs of
    Code:
    pvscan
    and
    Code:
    vgscan
    ?
     
  10. bschultz

    bschultz Member

    I found the problem...

    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!
     
  11. bschultz

    bschultz Member

    I tried to format the drive...

    Code:
    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?
     
  12. sjau

    sjau Local Meanie Moderator

    You have to unmount it first:

    Code:
    umount /dev/sde1
    
     
  13. bschultz

    bschultz Member

    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
     
  14. falko

    falko Super Moderator ISPConfig Developer

    You can try to kill all processes that use /dev/sde1 by running
    Code:
    fuser -k /path/to/mount_point
    Afterwards 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
     

Share This Page