> I installed Ubuntu 16.04 64-bit onto a 500 GB drive, and would like to 
> migrate the entire installation to a larger drive. S

As always, there's more than one way to do it.  All of them start with 
making sure you have a backup in case things go horribly wrong.  After 
that, here's what I'd do:

1) Shut down the system
2) Plug in the new drive, in addition to the old drive
3) Boot up a rescue CD/DVD/USB drive.  Anything that can get you to a 
memory-based Linux prompt will do.  CentOS/RedHat/Ubuntu installation 
DVDs all have a rescue system on them, as I imagine do most others.
4) Become root, and run "dd if=/dev/OLDDRIVE of=/dev/NEWDRIVE bs=5120", 
replacing OLDDRIVE and NEWDRIVE with the appropriate drives.  You can 
use fdisk -l to see the drives and their sizes, to be sure the rescue 
system named the disks the way you expect.
5) Power down and remove the old drive.  At that point you can boot and 
run on the new drive, but you don't have any more space yet.
6) Boot up from the hard disk and add a new partition on the new drive 
covering the added space.  Depending on your system, you may need to 
reboot or run partprobe on the disk for the kernel to recognize the new 
partition.
7) Extend your volume group onto the new partition.  If your volume 
group is called "system" and your new partition is /dev/sda7: vgextend 
system /dev/sda7.  You know what partition you created, and you can 
enter "vgdisplay" to see your volume group name if you don't know it.

Step 4 is the most delicate -- if you cross up your drives you'll 
overwrite your data, so make sure you get those right.

After that, you're done.   Your volume group uses space off of two (or 
more) partitions on the same disk, but it will happily spread logical 
volumes across them if it needs to, so that's not a problem.  There are 
other approaches that involve making the original LVM partition bigger, 
but they're more involved without much benefit over this approach.

                   -Brian Martin

-- 
--------------------
Brian P. Martin, Chief Consultant
Martin Consulting Services, Inc.
Phone: 503-617-4500
E-mail: [email protected]

_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to