Link to home
Start Free TrialLog in
Avatar of Alexandre Takacs
Alexandre TakacsFlag for Switzerland

asked on

Stuck with lvextend syntax

Hi

Probably an obvious one but for the life of me I can't seem to find the right syntax for the lvextend command under ubuntu 16.04.6:
someadmin@tableau-sx-01:/dev$ sudo pvs
  PV         VG               Fmt  Attr PSize  PFree
  /dev/sda5  tableau-sx-01-vg lvm2 a--  59.28g 10.02g
someadmin@tableau-sx-01:/dev$ sudo lvextend –rl +100%FREE /dev/sda5
  Path required for Logical Volume "–rl".
  Please provide a volume group name
  Run `lvextend --help' for more information.
someadmin@tableau-sx-01:/dev$ sudo lvextend –rl +100%FREE /dev/sda5 tableau-sx-01-vg
  Path required for Logical Volume "–rl".
  Please provide a volume group name
  Run `lvextend --help' for more information.
someadmin@tableau-sx-01:/dev$ sudo lvextend –rl +100%FREE tableau-sx-01-vg /dev/sda5 
  Path required for Logical Volume "–rl".
  Please provide a volume group name
  Run `lvextend --help' for more information.

Open in new window


As you have guessed I am trying to resize /dev/sda5

What is the "correct" syntax ?
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

you need a volume group to extend

lvextend -L +54 /dev/vg01/lvol10 /dev/sdk3

Open in new window


Extends the size of logical volume "vg01/lvol01" by the amount of free space on physical volume /dev/sdk3. This is equivalent to specifying "-l +100%PVS" on the command line:
Avatar of Alexandre Takacs

ASKER

well I have only one partition and it is my boot volume - so the cloudberrylab linked procedure is a no go
you need a volume group to extend

Well from my trials linked above:

someadmin@tableau-sx-01:/dev$ sudo pvs
  PV         VG               Fmt  Attr PSize  PFree
  /dev/sda5  tableau-sx-01-vg lvm2 a--  59.28g 10.02g

Open in new window

So my assumption is that my volume group to extend is tableau-sx-01-vg ?

someadmin@tableau-sx-01:/dev$ sudo lvextend -L +54 /dev/mapper/tableau-sx-01-vg-root /dev/sda5
  skip_dev_dir: Couldn't split up device name tableau-sx-01-vg-root.
  Path required for Logical Volume "tableau-sx-01-vg-root".
  Please provide a volume group name
  Run `lvextend --help' for more information.
someadmin@tableau-sx-01:/dev$ sudo lvextend -L +54 tableau-sx-01 /dev/sda5
  Path required for Logical Volume "tableau-sx-01".
  Please provide a volume group name
  Run `lvextend --help' for more information.

Open in new window


If so what you be the command I should use ? Doesn't seem to be able figure it out...
lvextend -L +54 /dev/tableau-sx-01-vg/lvol1 /dev/sda5

guessing logical volume 1
Thanks - clearly not volume1 though

someadmin@tableau-sx-01:/dev$ sudo lvextend -L +54 /dev/tableau-sx-01-vg/lvol1 /dev/sda5
  Logical volume lvol1 not found in volume group tableau-sx-01-vg
someadmin@tableau-sx-01:/dev$ sudo lvscan
  ACTIVE            '/dev/tableau-sx-01-vg/root' [48.31 GiB] inherit
  ACTIVE            '/dev/tableau-sx-01-vg/swap_1' [976.00 MiB] inherit
someadmin@tableau-sx-01:/dev$ sudo lvs
  LV     VG               Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   tableau-sx-01-vg -wi-ao----  48.31g
  swap_1 tableau-sx-01-vg -wi-ao---- 976.00m
someadmin@tableau-sx-01:~$ sudo parted
[sudo] password for someadmin:
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  768MB   767MB   primary   ext2         boot
 2      769MB   64.4GB  63.7GB  extended
 5      769MB   64.4GB  63.7GB  logical                lvm

(parted)

Open in new window

Anyone ? I'm sure it must be rather a trivial quesiton ?!
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the suggestion. I do have a backup (as a matter of fact it is a VM).

Should I simply "clone" the volume to a larger one ?
Well it turns out there is apparently no way to do this. Eventually had to destroy and recreate the volume.