Gordon said:
My current HDD does not have Windows on it!
The "recovery" partition was never there. This laptop originally came
with Vista and then I installed Win 7 on it from a genuine Windows 7
install disk, not a recovery disk!
The reason for the larger HDD is so that I can dual boot properly. The
current HDD is only 80GB, which is too small to dual boot.
So after the installation of the new HDD, all I need to do is to boot
from the Win 7 disk - nothing else needs doing first?
OK, so now we know what kind of user you are.
An experienced Linux user.
So "dd" is no mystery to you.
You don't need any fancy utilities to do this, as long as you have the space.
------+
Step 1|
------+
Boot the laptop with your Linux LiveCD.
In "Places", click the icon for the external USB drive, so it
is mounted. You need room to store the laptop drive image.
If the laptop drive is 40GB in size, this will create a 40GB file
on the external. Let's say the external mount is /media/PETUNIA
Open a terminal window and from the shell...
sudo dd if=/dev/sda of=/media/PETUNIA/mylaptop.dd
That will copy the entire laptop drive, including sector 0 MBR,
GRUB boot stages hiding in the reserved sectors, and so on. A
complete copy will be made.
*******
If you're clever, you can also give that command a block side (bs)
and count parameters. To figure out those, you can try the Linux
fdisk command, before doing the "dd" step. This portion is optional
if you don't mind "dd" taking three times longer than it should.
sudo fdisk /dev/sda
p <--- this prints the disk parameters
q <--- quit the tool
Now, if that works, there will be a total byte count in the printout.
Now, use the "factor" command.
factor 42949017600
That returns:
42949017600: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 5 5 17 257
We count up the number of two's there. In this example (from my
Linux virtual machine in fact), the number is 2**17 or 131072.
If you divide 42949017600 by 131072, you should get a nice round
number as well. Now, we can modify our "dd" command a bit.
sudo dd if=/dev/sda of=/media/PETUNIA/mylaptop.dd bs=131072 count=327675
By specifying a block size, the command runs about three times faster,
so you don't have to wait as long.
An alternate form of the command, is like this, with no count. If you
do it this way, the transfer runs until there is no source disk left
to read from. The actual count is printed on the screen. You compare the
count printed on the screen, to the value you computed (327675), to see
whether all the data was transferred.
sudo dd if=/dev/sda of=/media/PETUNIA/mylaptop.dd bs=131072
*******
------+
Step 2|
------+
Now, sudo umount /media/PETUNIA, do a shutdown of the laptop, install
the new hard drive. Boot the Linux LiveCD again.
------+
Step 3|
------+
Click the icon for your external disk. We'll again assume it ends up
as /media/PETUNIA. Use the "dd" command, to transfer from the external,
to the new internal laptop drive. We'll assume the new drive ends up at
/dev/sda as well. You can use "sudo lshw" or "sudo ls /dev" to perhaps
figure that bit out. Mounting the new drive, by clicking the icon
(as new drives are typically formatted), then using "df" is another
way to confirm the block level ID of the new drive. Dismount the
new drive partition, before using "dd".
OK, assuming we've verified it's /dev/sda again, we can do:
sudo dd if=/media/PETUNIA/mylaptop.dd of=/dev/sda bs=131072
Which should take as long as Step 1 did.
Now, sudo umount /media/PETUNIA, shutdown the laptop. Time to
reboot from the internal hard drive, and confirm the transfer
was a success.
Result - the partitions in Linux, are exactly the same size
as they were originally. There is now a 40GB or larger "unallocated"
section at the end of the disk. And that's where new partitions
will go. There is no need to resize the Linux partitions with
"sudo gparted", unless you want to. You could do that from
your Linux LiveCD as well.
*******
Now, you need to find a dual boot recipe, for Linux + Windows 7.
Plug something like this into your search engine:
dual boot linux plus windows 7
This one is no good, because it assumes Windows 7 is on there already,
and Linux installs second. This doesn't help us a bit. That's because,
it is dead easy to use GRUB, to beat Windows into submission at boot time
(chain load).
http://lifehacker.com/5403100/dual+boot-windows-7-and-ubuntu-in-perfect-harmony
In the example here, they install Windows after Linux.
http://www.ehow.com/how_7488102_install-windows-xp-linux-system.html
The key part there, is Windows is going to wipe out some of GRUB. You
install Windows, like your Windows 7, shut down, boot the Linux LiveCD,
restore GRUB with the commands they use, then on next reboot, you're
booting Linux again. Using the GRUB menu, you add Windows 7 as a chain
load. To find that, I used "install windows on a linux machine" as
a search term.
Before you start, there have to be enough partitions for the install
of course. I don't know how many partitions your original Linux
was using, in which case Windows 7 will use one or two. Windows 7
uses one partition, if doing a BitLocker full drive encryption incompatible install.
Windows 7 uses two partitions (like a 100MB SYSTEM RESERVED partition),
if the install is BitLocker compatible. Only the higher end versions
of Windows 7 (like Ultimate), include BitLocker, as far as I know.
You might want to review the necessary procedures for specifying
one or two partitions, for the Windows 7 install, before you
do your Windows install.
http://www.sevenforums.com/tutorials/1649-clean-install-windows-7-a.html?filter[2]=General Tips
"If you do not want to have the 100 MB System Reserved partition
and only the Windows 7 C: partition on a HDD or SSD after installation,
then select a formatted partition or drive to install Windows 7 on.
If there are any partitions on the disk, you won't get the 100 MB
System Reserved."
To do that with your Linux LiveCD, or from the existing Linux,
you'd use "sudo fdisk /dev/sda", and add a partition. Change the
partition type for the new partition, to "7" for NTFS. Enter
"W" to write out the new partition information. Then "Q" to quit.
That defines a partition. Next, use "man mkfs.nfts" to review
the commands for formatting the new partition. It'll be
something like "sudo mkfs.ntfs -L Windows7 -v -f /dev/sda2",
assuming the new partition created in fdisk was partition 2.
Obviously, you have to be careful with the mkfs.ntfs command,
as you could overwrite an existing partition if you get the
partition number wrong. A safer way, might be to create an
NTFS partition from "sudo gparted".
Then, hope Windows 7 installer DVD, finds your offering of an
NTFS partition, so you can do a single partition install.
HTH,
Paul