Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to migrate my system to LVM. My current setup is the following:

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x6fa8e725

   Device Boot      Start         End      Blocks   Id  System
/dev/sda4       662097920  1953523711   645712896    f  W95 Ext'd (LBA)
/dev/sda5   *   662099968  1945352191   641626112   83  Linux
/dev/sda6      1945354240  1953523711     4084736   82  Linux swap / Solaris
Note: sector size is 4096 (not 512)

My plan is the following:

  • Create LVM partition in unallocated space from 0 to 662097920
  • Copy everything to it.
  • Delete everything from 662097920 to 1953523711
  • Extend LVM to have 100% of the HDD

How can I do this ? I'm on Kubuntu 13.04

Status update: I created a primary partition on the unallocated space, to use pvcreate afterwards on that partition to create the LVM. Next step should be to copy everything to it, and delete the former partitions, and after, extend the primary partition where the LVM resides.

share|improve this question

migrated from stackoverflow.com Jul 15 '13 at 11:18

This question came from our site for professional and enthusiast programmers.

    
Your partitions are MiB-aligned so it would be possible to map them to LV directly if you use a PE size of 1MiB. In which case no copy at all would be required. Copying is a lot simpler, though, if you have the space to accomodate the copy. –  frostschutz Jul 15 '13 at 12:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.