| Move Linux to a New Hard Drive |
|
|
| Saturday, 23 July 2011 | |
|
Let's say our hard drive is old and we want to move our Linux installation to a new hard drive. There are multiple ways of moving your installed Linux to a new drive, we will show you only two of them. The simplest one that can be used if your new drive is the same size as your old drive would be using dd: dd if=/dev/sda of=/dev/sdb bs=1M where sda is our old drive and sdb is our new drive. This command will make an identic copy of your old drive. But what to do if our newer drive is bigger? Well, a nice solution is to create same number of partitions as old drive, but using bigger partition sizes, and then we will move data from every partition using dump and restore utilities. Remember that /dev/sda is our old drive and /dev/sdb is our new drive. We will look how many partitions are on /dev/sda with fdisk fdisk /dev/sda Then press p (print partitions on the screen). We will get something like this: fdisk /dev/sda Command (m for help): pDisk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000f3ddf Device Boot Start End Blocks Id System /dev/sda1 * 1 32 248832 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 32 2611 20719617 5 Extended /dev/sda5 32 2611 20719616 8e Linux LVM Then we will go to our new drive and will create three partitions, sdb1, sdb2 and sdb5. We notice second partition is Linux type. We can change the type by pressing t and choosing partition number, which is 2 in our case. Then we type 8e to change partition type to Linux LVM. |
|
| Last Updated ( Saturday, 23 July 2011 ) |
| < Prev | Next > |
|---|

