View previous topic :: View next topic |
Author |
Message |
<3 Veteran
Joined: 21 Oct 2004 Posts: 1081
|
Posted: Tue Dec 10, 2013 3:42 pm Post subject: Making an image of an entire hard drive. (solved) |
|
|
I have a laptop that I use for work, it is a dual-boot Win7/Gentoo GNU/Linux machine, that unfortunately needs repair due to my clumsiness. I have an extended warranty on the hardware so the insurer requires that if I want my laptop fixed that I need to take the hardware into an established computer repair shop (they will not pay for me to fix it myself). Before I take the laptop into a computer repair shop I want to make backup of my entire hard drive including all partitions, (Win 7 (ntfs), swap, root (ext4), boot (ext2) and an extra ntfs partition). Is it possible for me to make an image of the entire drive (partition layout and all) and back it up to a spare hard drive that I have laying around?
Last edited by <3 on Sat Dec 14, 2013 8:37 am; edited 1 time in total |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3104
|
Posted: Tue Dec 10, 2013 4:06 pm Post subject: |
|
|
`dd if=/dev/sda of=/dev/sdb bs=64M`
where /dev/sda is damaged device and /dev/sdb is a new one (phisical devices, not partitions' numbers) - make sure you replace paths with correct one.
Devices with equal size are preferred since it will make a copy, but if you use bigger target drive you can repartition it afterwards to reclaim unused space |
|
Back to top |
|
|
wjb l33t
Joined: 10 Jul 2005 Posts: 601 Location: Fife, Scotland
|
Posted: Tue Dec 10, 2013 5:19 pm Post subject: |
|
|
Clonezilla. Does what it says on the tin. |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10587 Location: Somewhere over Atlanta, Georgia
|
Posted: Tue Dec 10, 2013 5:30 pm Post subject: |
|
|
szatox wrote: | Devices with equal size are preferred since it will make a copy, but if you use bigger target drive you can repartition it afterwards to reclaim unused space | Better to write to a file on the mounted second drive if, as I'm assuming, the goal is to later restore the exact image to the repaired laptop's hard drive.
By the way, it goes without saying that no part of /dev/sda should be mounted while this copy is being made. Doesn't it?
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Tue Dec 10, 2013 6:20 pm Post subject: |
|
|
You can use the dcfldd command instead of dd, you will see a progress output that dd do not show.
If you try to restore the backup to an other drive than the one who Windows was installed in, Windows can refuse to boot. Windows memorise the exact first sector where it start on the partition and if that have change after the restauration it will not boot.
I ever had this problem before. A Gentoo user in this forum told me I have to use an hexadecimal editor on the Windows partition to change the written first sector where Windows memorise it to correspond to the starting new one after the restauration.
Again, you see that manipulating Windows filesystems can be more complicated than the Linux ones. This example is only one licence restriction consequence. _________________ Paul |
|
Back to top |
|
|
<3 Veteran
Joined: 21 Oct 2004 Posts: 1081
|
Posted: Wed Dec 11, 2013 1:50 am Post subject: |
|
|
I don't plan on changing the disk, So after they fix the problems with the laptop I will restore the image on the original drive, hopefully I won't have that problem. |
|
Back to top |
|
|
<3 Veteran
Joined: 21 Oct 2004 Posts: 1081
|
Posted: Thu Dec 12, 2013 2:34 am Post subject: |
|
|
This clonezilla program does not appear to be in portage. Also I just realized I will not be able to use dd because I am backing up a 500GB drive and the largest back-up drive I hava available is only 320GB which means I am going to have to do a full reinstall =(. |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10587 Location: Somewhere over Atlanta, Georgia
|
Posted: Thu Dec 12, 2013 2:56 am Post subject: |
|
|
Not necessarily. Try, for example, compressing the image: Code: | dd bs=10M if=/dev/sda | bzip2 >image.bz2 | Might very well fit in a file smaller than 320GiB.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
hadrons123 Tux's lil' helper
Joined: 08 Mar 2012 Posts: 90 Location: chennai
|
Posted: Thu Dec 12, 2013 3:27 am Post subject: |
|
|
<3 wrote: | This clonezilla program does not appear to be in portage. Also I just realized I will not be able to use dd because I am backing up a 500GB drive and the largest back-up drive I hava available is only 320GB which means I am going to have to do a full reinstall =(. |
Clonezilla is not necessary to be in portage to perform this task. Its very easy to download the clonezilla live booting .iso image into a USB drive and transfer all your partitions to another drive. I do this on a daily basis. No failures in the last 6 months.
http://clonezilla.org/downloads/download.php?branch=stable _________________ LENOVO Y580 FHD Intel® Core™ i7-3630QM CPU @ 2.40GHz × 8 |660M GTX NVIDIA | 16GB SanDisk SSD |
|
Back to top |
|
|
lost+found Guru
Joined: 15 Nov 2004 Posts: 509 Location: North~Sea~Coa~s~~t~~~
|
|
Back to top |
|
|
hadrons123 Tux's lil' helper
Joined: 08 Mar 2012 Posts: 90 Location: chennai
|
Posted: Thu Dec 12, 2013 8:05 am Post subject: |
|
|
@lost+found
clonezilla does everything you suggested and its easy to manage as well. _________________ LENOVO Y580 FHD Intel® Core™ i7-3630QM CPU @ 2.40GHz × 8 |660M GTX NVIDIA | 16GB SanDisk SSD |
|
Back to top |
|
|
wjb l33t
Joined: 10 Jul 2005 Posts: 601 Location: Fife, Scotland
|
Posted: Thu Dec 12, 2013 11:35 am Post subject: |
|
|
Clonezilla is a bootable image - CD/USB, whatever. Can do all the partitions or just pick the ones you want. Its quick and produces relatively small images because it only looks at the used parts of the file systems. It knows about a lot of file system types, but will use dd to do a sector copy if its not one of these. You can restore into the same sized or larger disk. Used it at work to image W7/XP pcs, and on a mixture of PCs at home - never really had any problems with it. The website does have a very good step by step guide - which you wouldn't need after the first couple of times.
The command it uses is shown to you at some point so you can re-use the same one later without having to go through the menus again. |
|
Back to top |
|
|
silentplummet n00b
Joined: 14 Jun 2004 Posts: 58
|
Posted: Sat Dec 28, 2013 2:03 am Post subject: |
|
|
You can make dd display current progress by sending it a signal either directly through terminal or by another process like killall. On my machine I think it's ^T or ^V that makes it work. |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6051 Location: Removed by Neddy
|
Posted: Mon Dec 30, 2013 9:52 am Post subject: |
|
|
Problem with DD is it copies the "empty" space as well _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
<3 Veteran
Joined: 21 Oct 2004 Posts: 1081
|
Posted: Mon Dec 30, 2013 11:05 am Post subject: |
|
|
Thx guys I managed to get it to work using clonezilla, it was fairly easy to use too. |
|
Back to top |
|
|
|