3

It looks like my partition table are all screwed up and of course now when I'm at a loss for disk space I'm realizing a huge mistake. I don't think all of my disk space was allocating when I first installed and partitioned setting up LVM. from what I see I have about 200GB of space I can add to vg_root but I'm unsure what the risk or impact is with my current vg_root at 100%

lsblk

NAME                       MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                          8:0    0 232.9G  0 disk 
├─sda1                       8:1    0   243M  0 part /boot
├─sda2                       8:2    0     1K  0 part 
└─sda5                       8:5    0 232.6G  0 part 
  ├─--vg-root (dm-0)   252:0    0  33.3G  0 lvm  /
  └─--vg-swap_1 (dm-1) 252:1    0   3.9G  0 lvm  [SWAP]
sdb                          8:16   0   1.8T  0 disk 
└─sdb1                       8:17   0   1.8T  0 part /media/2TB

lvs

LV     VG      Attr      LSize  Pool Origin Data%  Move Log Copy%  Convert
  root   vg -wi-ao--- 33.32g
swap_1 vg -wi-ao--- 3.93g

df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G  4.0K  2.9G   1% /dev
tmpfs           596M  1.2M  595M   1% /run
/dev/dm-0        33G   33G     0 100% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            3.0G  4.0K  3.0G   1% /run/shm
none            100M     0  100M   0% /run/user
/dev/sdb1       1.8T  1.6T  127G  93% /media/2TB
overflow        1.0M  140K  884K  14% /tmp
/dev/sda1       228M   63M  154M  29% /boot

I'm thinking lvextend can expand the vg but as I said I'm unsure of the implication and I don't want to loose my data...

cat /etc/lsb-release

DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"

Thanks

mook765
  • 15,925
carter
  • 71
  • 1
  • 5

1 Answers1

3

using a VM I created another test instance and verified extending the VG, then extending the filesystem solved my problem, it seems :)

root@ubuntu-test:~# df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               2.0G  4.0K  2.0G   1% /dev
tmpfs                              396M  720K  395M   1% /run
/dev/mapper/ubuntu--test--vg-root   20G  1.4G   18G   8% /
none                               4.0K     0  4.0K   0% /sys/fs/cgroup
none                               5.0M     0  5.0M   0% /run/lock
none                               2.0G     0  2.0G   0% /run/shm
none                               100M     0  100M   0% /run/user
/dev/sda1                          236M   39M  185M  18% /boot
root@ubuntu-test:~# lvextend -l +100%FREE /dev/ubuntu-test-vg/root
  Extending logical volume root to 35.76 GiB
  Logical volume root successfully resized
root@ubuntu-test:~# resize2fs /dev/mapper/ubuntu--test--vg-root
resize2fs 1.42.9 (4-Feb-2014)
Filesystem at /dev/mapper/ubuntu--test--vg-root is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 3
The filesystem on /dev/mapper/ubuntu--test--vg-root is now 9374720 blocks long.
root@ubuntu-test:~# df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               2.0G  4.0K  2.0G   1% /dev
tmpfs                              396M  720K  395M   1% /run
/dev/mapper/ubuntu--test--vg-root   36G  1.4G   33G   4% /
none                               4.0K     0  4.0K   0% /sys/fs/cgroup
none                               5.0M     0  5.0M   0% /run/lock
none                               2.0G     0  2.0G   0% /run/shm
none                               100M     0  100M   0% /run/user
/dev/sda1                          236M   39M  185M  18% /boot
carter
  • 71
  • 1
  • 5