1

I'm trying to extend my hard disk, but it doesn't work correctly. According to many suggestions on the internet, I ran this command:

$ sudo lvresize --extents +100%FREE --resizefs WWW-vg/root
  Size of logical volume WWW-vg/root unchanged from 47.52 GiB (12165 extents).
  Logical volume root successfully resized.
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 12456960 (4k) blocks long.  Nothing to do!

I also tried this command:

$ sudo lvextend -l +100%FREE WWW-vg/root
  New size (12165 extents) matches existing size (12165 extents)
  Run élvextend --help' for more information.

I'm sure, I've added the hard disk because when run lsblk, I'll get this output:

NAME               MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                  8:0    0  110G  0 disk 
├─sda1               8:1    0  487M  0 part /boot
├─sda2               8:2    0    1K  0 part 
└─sda5               8:5    0 49.5G  0 part 
  ├─WWW--vg-root   252:0    0 47.5G  0 lvm  /
  └─WWW--vg-swap_1 252:1    0    2G  0 lvm  ÄSWAPÅ
sr0                 11:0    1 1024M  0 rom  

It's confusing to me why the size of the sda is 110G but the sum of sda1,sda2,sda5 is 50G. Where is another 60G? How can I add this 60G to my WWW--vg-root?

Here's some information about my device that I hope they help.

$ lvs -o +devices
  LV     VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices         
  root   WWW-vg -wi-ao---- 47.52g                                                     /dev/sda5(0)    
  swap_1 WWW-vg -wi-ao----  2.00g   
$ df -h
Filesystem                Size  Used Avail Use% Mounted on
udev                      979M     0  979M   0% /dev
tmpfs                     200M  5.9M  195M   3% /run
/dev/mapper/WWW--vg-root   47G   17G   29G  37% /
tmpfs                    1000M     0 1000M   0% /dev/shm
tmpfs                     5.0M     0  5.0M   0% /run/lock
tmpfs                    1000M     0 1000M   0% /sys/fs/cgroup
/dev/sda1                 472M  110M  338M  25% /boot
tmpfs                     200M     0  200M   0% /run/user/1000
$ pvdisplay -m
--- Physical volume ---
  PV Name               /dev/sda5
  VG Name               WWW-vg
  PV Size               49.52 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              12677
  Free PE               0
  Allocated PE          12677
  PV UUID               Xukces-Bzjn-Sqkk-klvc-wm6I-FwfM-bFuzjx

--- Physical Segments --- Physical extent 0 to 12164: Logical volume /dev/WWW-vg/root Logical extents 0 to 12164 Physical extent 12165 to 12676: Logical volume /dev/WWW-vg/swap_1 Logical extents 0 to 511

$ fdisk -l
Disk /dev/sda: 110 GiB, 118111600640 bytes, 230686720 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
Disklabel type: dos
Disk identifier: 0x399c3ae0

Device     Boot   Start       End   Sectors  Size Id Type
/dev/sda1  *       2048    999423    997376  487M 83 Linux
/dev/sda2       1001470 104855551 103854082 49.5G  5 Extended
/dev/sda5       1001472 104855551 103854080 49.5G 8e Linux LVM




Disk /dev/mapper/WWW--vg-root: 47.5 GiB, 51023708160 bytes, 99655680 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 /dev/mapper/WWW--vg-swap_1: 2 GiB, 2147483648 bytes, 4194304 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

And this is my ubuntu version

Ubuntu 16.04.07 LTS
Ali
  • 11

0 Answers0