[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: File transfer



On 02/27/2015 07:48 PM, Maureen L Thomas wrote:
If I understand you correctly then I only back up data, not the system.
You have an excellent point and although I have never, so far at least,
had a large problem losing my system or data I do see the advantage to
doing just what you have said.  I will be buying the book you suggested
and hopefully get through enough to do a back up of the new system
before I actually go on line with it.
Thank you for the info.

You're welcome. :-)


I seem to recall that the book is good for concepts and advice, but light on implementation details.


To take an image of your system drive:

1.  Shut down the computer.

2.  Connect your image destination drive (e.g. USB external hard drive).

3. Boot the computer using a Debian installation disc or USB drive. I use the Wheezy "netinst" image. You may need to configure your BIOS, press F10, change the ordering of devices connected to USB ports, etc..

4. Choose Advanced Options -> Rescue Mode. Proceed through configuration screens which may vary from mine depending upon your network environment (select language, select location, configure keyboard, enter host name, enter domain name, configure clock). Don't enter encryption passphrases, configure LVM, mount drives, etc.. When you get to the "Enter rescue mode" screens, choose "Do not use a root file system" -> "Execute a shell in the installer environment" -> "Continue". This will give you an "ash" shell prompt in the "BusyBox" environment, and raw access to all the connected drives.

5. Be very careful typing commands -- you are running as root, and one fumbled key stroke could be disastrous. Double check every command line before pressing the <Enter> key.

6. Figure out the path to your system drive, how many blocks are in use on your system drive (use the "start" sector number for the free space after the last partition), your image destination drive, and your image destination partition. I use "parted":

    # parted /dev/sda u s p free
    ...

For my computer "p43200", /dev/sdc is the system drive, 28125184 sectors are in use, /dev/sda is the image destination drive, and /dev/sda1 is the image destination partition.

7.  Mount the image destination partition:

    # mount /dev/sda1 /mnt

8. Copy the system drive raw device contents to a file on the image destination file system:

# dd if=/dev/sdc of=/mnt/image/p43200/p43200-20150227-2200-debian-7-amd64-xfce-op.img count=28125184

9.  Create a checksum file:

    # cd /mnt/image/p43200

# md5sum -b p43200-20150227-2200-debian-7-amd64-xfce-op.img > p43200-20150227-2200-debian-7-amd64-xfce-op.img.md5

    Make the modification times match:

# touch -r p43200-20150227-2200-debian-7-amd64-xfce-op.img p43200-20150227-2200-debian-7-amd64-xfce-op.img.md5

10. Exit the shell:

    # exit

11. Choose "Reboot the system". Wait for the installer to shut down and the computer to reach POST. Power off the machine. Disconnect your Debian installation USB drive and your image destination drive.


Verifying the image by wiping the system drive and then restoring the image:

1. Wipe the system drive using your tool of choice (such as the drive manufacturer's bootable utility disc).

2.  Perform imaging steps 1 through 7, above.

3.  Verify the checksum of the image file:

    # cd /mnt/image/p43200

    # md5sum -c p43200-20150227-2200-debian-7-amd64-xfce-op.img.md5

4.  Restore the image file to the system drive:

    # dd if=p43200-20150227-2200-debian-7-amd64-xfce-op.img of=/dev/sdc

Look at the block count when done -- it should match what you started with. (Things might be goofy if the system drive and the image destination drive use different block sizes.)

5.  Perform imaging steps 10 and 11, above.

6. Boot the system, log in, and have a look around. If everything looks good, proceed with using the computer. If it's broken, wipe the system drive, do a fresh install, and try again.


David


Reply to: