1

It's been a long time since I've done this and I've probably done it in the most complex way. I upgraded my OS drive to a larger drive (old one 60GB, new one 250GB) running Ubuntu 14.04 and used ddrescue to create an image of the old disk and then restore the image onto the new disk. I had to create/restore the image in separate steps because I could only attach one disk at a time to my laptop.

ddrescue -d -r3 /dev/sda os_drive.img create_image.log
ddrescue -f os_drive.img /dev/sda restore_image.log

The system runs fine with the new disk but of course only has 60GB showing up as the capacity. I'm guessing that I need to expand the partition, extend the LVM, then resize my ext4 file system. I'm not sure if that's correct.

I'm more than happy to redo this from scratch using an easier method to copy the disk contents. I am using VirtualBox on my OSX laptop to do the ddrescure with the drives connected one at a time via USB. Another option that I was considering is using Clonezilla.

fdisk:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008035d

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   125044735    62271489    5  Extended
/dev/sda5          501760   125044735    62271488   8e  Linux LVM

Disk /dev/mapper/nobox--vg-root: 59.5 GB, 59466842112 bytes
255 heads, 63 sectors/track, 7229 cylinders, total 116146176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

parted:

Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 488397168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start    End         Size        Type      File system  Flags
1      2048s    499711s     497664s     primary   ext2         boot
2      501758s  125044735s  124542978s  extended
5      501760s  125044735s  124542976s  logical                lvm

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/nobox--vg-root: 116146176s
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End         Size        File system  Flags
1      0s     116146175s  116146176s  ext4

vgdisplay:

VG Name               nobox-vg
System ID
Format                lvm2
Metadata Areas        1
Metadata Sequence No  3
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                2
Open LV               2
Max PV                0
Cur PV                1
Act PV                1
VG Size               59.38 GiB
PE Size               4.00 MiB
Total PE              15202
Alloc PE / Size       15202 / 59.38 GiB
Free  PE / Size       0 / 0
VG UUID               LJMh7v-rslr-ec79-MCxL-RoqQ-zJ9n-0CNfq3

pvdisplay:

PV Name               /dev/sda5
VG Name               nobox-vg
PV Size               59.39 GiB / not usable 4.00 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              15202
Free PE               0
Allocated PE          15202
PV UUID               qYZ8cg-RzrA-Dv3s-pSkZ-MZY6-MJsa-a59XCb

lvdisplay:

LV Path                /dev/nobox-vg/root
LV Name                root
VG Name                nobox-vg
LV UUID                TavnN5-q5YR-jeXh-ceY9-rCYD-mjFR-Cv645y
LV Write Access        read/write
LV Creation host, time ,
LV Status              available
# open                 1
LV Size                55.38 GiB
Current LE             14178
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           252:0

1 Answer 1

0

I ended up trying Clonezilla and that didn't resize the disk either. What did end up working was:

  • Use Clonezilla to copy the disk from 64GB to 250GB drive
  • Use Ubuntu Live USB to run the repair install operation and install GRUB on the disk
  • Run GParted from Ubuntu Live USB as root and execute "Partition > Check" from the menu to allocate unused space.
  • Boot into system
  • Run lvextend -l +100%FREE /dev/vg-name/root
  • Run resize2fs /dev/vg-name/root

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .