LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 04-22-2006, 12:48 PM   #1
mike160
Member
 
Registered: Jan 2006
Location: Connecticut
Distribution: Ubuntu 10.10, Lubuntu 10.10, #!Crunchbang 10 "Statler"
Posts: 84

Rep: Reputation: 15
I need to clone a laptop hard drive


My father-in-law has an old 10gig laptop drive containing winxp, hes purchased a newer 40gig drive and wants to make an exact image of the existing drive to the new 40gig.

can this be done using an external USB harddrive caddy and a linux live CD???

I was think there must be a way to mount the new drive as "/dev/sda1" and then from the live cd use an extended version of

"cp /dev/hda1 /dev/sda1"

any help would be appreciated

Thank You
 
Old 04-22-2006, 01:10 PM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
dd if=/dev/hda1 of=/mnt/sda1/file.img?? man dd for details
 
Old 04-22-2006, 01:14 PM   #3
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
You can use 'dd' to read and write partitions of the drive back out. This would be effectively treating the drive as just a block device and reading in like such. I would treat the old drive as a read only backup. Make sure to have a good read of the DD manual. You do not need to mount the drives at all to do this.

However, this assumes you are writing out with an identically sized partition on the drive. There are tools to resize ext2 (and other) linux partitions - and one group who seem to be a little familiar with it are the colinux people, for the simple reason that their bootable images generally come as 2Gb sized drive images.

On the colinux wiki, there are references to resizing the FS image (so that it is actually much larger). I would therefore get hold of those tools - make sure you have read the info on them first, and make them available to your liveCD distro.

This would need to be done on a partition by partition basis though, and I do not think it could be used for the whole drive. It should not matter that it is an internal or external USB drive.
 
Old 04-22-2006, 01:28 PM   #4
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Quote:
...hes purchased a newer 40gig drive and wants to make an exact image of the existing drive to the new 40gig.
Don't new hard drives often come with software to clone from the old drive to the new one?
 
Old 04-22-2006, 01:52 PM   #5
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
Do they? None of mine did, but then I purchase them OEM no frills. And dont be surprised if that software works in windows only and fails completely to recognise non windows partitions.

Still, if it did, and its linux compatible, and it works well, then let me know which drive you bought - I know which ones I will consider in future.

Danny
 
Old 04-22-2006, 02:48 PM   #6
mike160
Member
 
Registered: Jan 2006
Location: Connecticut
Distribution: Ubuntu 10.10, Lubuntu 10.10, #!Crunchbang 10 "Statler"
Posts: 84

Original Poster
Rep: Reputation: 15
thanks for the quick replies... none of the partitions will be of the Linux variety... and now that i think about it linux might not recognize an ntfs partion without some help....

i'm thinking the easiest way to clone the laptop drive (running winxp pro) would be to install both drives in a desktop machine using laptop-to-ide adapters and norton ghost.

If you guys have an easier method please let me know....

alternativley my suggestion was to just back up the important stuff and then do a fresh install of XP.. (though I wish I could get him try out linux)

I will read through the dd man to get a better understanding of the utility

tahnks for the help
 
Old 04-22-2006, 03:21 PM   #7
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Quote:
Do they? None of mine did, but then I purchase them OEM no frills. And dont be surprised if that software works in windows only and fails completely to recognise non windows partitions.
Check this.
The copy feature lets you make an exact duplicate of your existing hard drive.

His idea to run Norton Ghost sounds like a good idea. The hard drive manufacturer's utility would be for if he did not have or want to purchase special software.
 
Old 04-23-2006, 07:56 AM   #8
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
Mike - dd will copy the partition, regardless of if it is NTFS, FAT, ExtFs or anything. However, I do not utilities to resize an NTFS partition. Maybe Symantec has an offering for that.

2damncommon - as predicted, the manufacturer provided windows only software, which would be a FAT (pun intended) lot of use for my fs's which are not FAT or NTFS based. You might be able to create the bootfloppy using DOSBox, and boot it, but again, it doesnt look like it has an awful lot to do with anything outside of Windows land - "Supports both FAT32 and NTFS drive partitions". Of course, it doesnt state that explicitly does not support other partitions though, and that might be up for test.

dd is not special software that needs to be purchased, it is free and comes with pretty much every *nix installation I know, and is available for windows under cygwin at least, if not with a variety of other ways. Using dd and a livecd is a fairly reasonable method - although the manufacturers utility will probably be more graphical and user friendly. MaxBlast still said nothing of resizing the partitions though. I am sure you could delegate parts of the filesystem to other partitions in lieu of being able to copy it onto a larger partition.

Danny
 
Old 04-23-2006, 04:31 PM   #9
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Quote:
2damncommon - as predicted, the manufacturer provided windows only software, which would be a FAT (pun intended) lot of use for my fs's which are not FAT or NTFS based.
Okay, however the OP is transfering Windows. Yes, the image download is stuck inside a Windows exe, which the OP would be able to access if he did not already have the software.
It was a valid suggestion for the OP.
 
Old 04-23-2006, 05:23 PM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Well the first link of my sigature documents the details of using a LiveCD to clone XP.

I would purchase a USB2 2.5" hard disk enclosure. Put the new 40Gb hard disk inside and so it will be read as sda in Linux. Boot up any LiveCD, change to superuser and issue the following command
Code:
dd if=/dev/hda of=/dev/sda bs=32768
Block size 32768 equal to 64 sectors times 512 bytes per sector so that the entire track is copied at a time. No bs parameter will force dd to default to 512 bytes per record and slow down the cloning. dd should clone at about 50Mb/sec for internal drives. In USB2 transfer it is a lot slower, probably between 1/4 to 1/3.

Watch out for the following

(1) A USB2 port supplies only 0.5 amp and this may be marginal for a 2.5" 40Gb hard disk. You should find the modern USB2 2.5" hard disk enclosure supplied with a twin head USB plug so that you draw current from two USB2 ports while one end connected to the enclosure.

(2) If the laptop has only one USB2 port then you can buy a USB port spliter which always comes with its own power supply. That power supply can be directly plugged into the 2.5" external enclosure if it has a 5DVC socket point (better models have but cheaper model don't) and so one laptop USB port is suffice if the hard disk has its own power. Alternatively just power up the USB port spliter and use 2 USB ports to power the external hard disk. The new 40Gb hard disk should have the power consumption printed on the casing. If the USB is under power you don't get reliable read/write data transfer.

(3) If the output-file (the target disk 40Gb) is bigger than the input-file (the source 10Gb) dd will copy the first 10Gb leaving the remaining 30Gb unallocated empty space.

(4) After cloning swap the 10Gb with the 40Gb and you should find it boots as the original.

(5) You can use Ghost but dd is faster and simpler.

(6) dd copies binary pattern sector by sector and so the boot sector in the partition is also copied making the target bootable. Also dd doesn't need to know the file system and so it can clone XP as easy as Linux, Dos, BSD or Solaris.

Last edited by saikee; 04-23-2006 at 05:27 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
laptop hard drive upgrade Arnaud_B Linux - Hardware 6 06-26-2005 01:27 AM
laptop hard drive won't stay down synaptical Linux - Laptop and Netbook 5 06-24-2005 08:33 AM
Clone a hard drive twantrd Solaris / OpenSolaris 10 02-05-2005 02:15 AM
Laptop Hard drive modules jdozarchuk Linux - Hardware 5 12-29-2004 08:12 AM
Easy way to clone linux installed hard drive mobassir Linux - Software 6 01-12-2004 05:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration