2

I've missed a step here. I had an 80GB boot drive that was filling up, so I replaced it with a 1TB drive.

From boot disk I dd'ed to copy it, worked great

From the Live CD I was able (after a lot of fighting/reading) for the partition to expand. I thought my life was great. System rebooted fine gpart showed the new size.

But DF still showed the old size, I see that my install of / is not pointing to sda but to /dev/mapper/ubuntu--vg-root

How do I adjust that size to use the new space?


# fdisk -l

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: 0x000411ff

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758  1953523711   976510977    5  Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5          501760  1953513471   976505856   8e  Linux LVM

# df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root   72G   68G   82M 100% /
none                         4.0K     0  4.0K   0% /sys/fs/cgroup
udev                         1.9G   12K  1.9G   1% /dev
tmpfs                        396M  2.1M  394M   1% /run
none                         5.0M     0  5.0M   0% /run/lock
none                         2.0G   80K  2.0G   1% /run/shm
none                         100M   44K  100M   1% /run/user
/dev/sda1                    236M  166M   59M  74% /boot
/dev/sdh1                    3.6T  3.0T  457G  87% /media/drive3
/dev/sdb1                    2.7T  2.4T  155G  95% /media/drive4
Zanna
  • 70,465
  • 2
    Your root partition can not change size with dd, you need to enlarge the partion. In your case you are using lvm, so, increase the size with system-config-lvm (install if needed). – Panther Mar 08 '15 at 22:32
  • I installed system-comfig-lvm but ended up using command line to adjust the LVM. It shows it on the management window but is referring only to /dev/ubuntu-vg/root(swap). /dev/mapper/ubuntu--vg-root is still the same size – Ken Curtis Mar 08 '15 at 23:57
  • You need to increase the size not only of the physical volume, but of the /dev/mapper/ubuntu--vg-root logical volume. The lvresize command can do this; see its man page for details. – Rod Smith Mar 09 '15 at 01:16
  • When I do lvdisplay it does not show the /dev/mapper/ubuntu--vg-root It does show /dev/ubuntu-vg/root and /dev/ubuntu-vg/swap

    Do I need to expand the /dev/ubuntu-vg/root to make room for more space to add to /dev/mapper/ubuntu--vg-root? I tried adding to both. /dev/ubuntu-vg/root Shows the new space but even after resizing that back down and adding it to /dev/mapper/ubuntu--vg-root there was no change.

    And why doesn't /dev/mapper/ubuntu--vg-root show up in the Logical Volume Management?

    – Ken Curtis Mar 09 '15 at 18:21

1 Answers1

2

OK After playing around for a few days here is what I did to move to a larger drive and expand my /

  • Boot from live CD with the new drive installed
  • use dd to copy old drive to new one, reboot
  • Boot back to CD and use gparted to expand the size
  • from Live CD lvsize to expand the /dev/ubuntu-vg/root (- not sure if I needed to do this part or not)
  • lvsize my /dev/mapper/ubuntu--vg-root
  • Here is the part I was missing: from live CD still, run

    resize2fs /dev/mapper/ubuntu--vg-root
    

BAM! my / is now expanded. I am not sure if all these steps are needed, they are just the ones I did to get it to work

Zanna
  • 70,465