How to better understand LVM and adding disks?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

4

I am playing around with understanding LVM and adding disks to a Linux box. I added a disk and then ran what I thought were commands to add this disk to the box, but I think I messed up.

Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

mount error..

mount -t xfs /dev/mapper/ol-lv_oradata  /mnt/drives/oradata
mount: wrong fs type, bad option, bad superblock on /dev/mapper/ol-lv_oradata,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

here are my outputs.

df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ol-root   27G   22G  5.1G  81% /
devtmpfs             1.4G     0  1.4G   0% /dev
tmpfs                1.4G   32M  1.4G   3% /dev/shm
tmpfs                1.4G  9.6M  1.4G   1% /run
tmpfs                1.4G     0  1.4G   0% /sys/fs/cgroup
/dev/sda1            497M  282M  216M  57% /boot
tmpfs                276M   60K  276M   1% /run/user/54321


 ls -ls /dev/sd*
0 brw-rw----. 1 root disk 8,  0 Jan  2 16:34 /dev/sda
0 brw-rw----. 1 root disk 8,  1 Jan  2 16:34 /dev/sda1
0 brw-rw----. 1 root disk 8,  2 Jan  3 13:53 /dev/sda2
0 brw-rw----. 1 root disk 8, 16 Jan  3 13:50 /dev/sdb  <-- this is the disk I added
0 brw-rw----. 1 root disk 8, 17 Jan  3 13:53 /dev/sdb1 <-- this is the disk I added

fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 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 label type: dos
Disk identifier: 0x0003e72b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 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 label type: dos
Disk identifier: 0x9a45daa3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   104857599    52427776   83  Linux

Disk /dev/mapper/ol-root: 28.4 GB, 28420603904 bytes, 55508992 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/ol-swap: 3221 MB, 3221225472 bytes, 6291456 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/ol-lv_oradata: 53.7 GB, 53687091200 bytes, 104857600 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

 lvmdiskscan
  /dev/ram0          [      16.00 MiB] 
  /dev/ol/root       [     <26.47 GiB] 
  /dev/ram1          [      16.00 MiB] 
  /dev/sda1          [     500.00 MiB] 
  /dev/ol/swap       [       3.00 GiB] 
  /dev/ram2          [      16.00 MiB] 
  /dev/sda2          [      29.51 GiB] LVM physical volume
  /dev/ol/lv_oradata [      50.00 GiB] 
  /dev/ram3          [      16.00 MiB] 
  /dev/ram4          [      16.00 MiB] 
  /dev/ram5          [      16.00 MiB] 
  /dev/ram6          [      16.00 MiB] 
  /dev/ram7          [      16.00 MiB] 
  /dev/ram8          [      16.00 MiB] 
  /dev/ram9          [      16.00 MiB] 
  /dev/ram10         [      16.00 MiB] 
  /dev/ram11         [      16.00 MiB] 
  /dev/ram12         [      16.00 MiB] 
  /dev/ram13         [      16.00 MiB] 
  /dev/ram14         [      16.00 MiB] 
  /dev/ram15         [      16.00 MiB] 
  /dev/sdb1          [     <50.00 GiB] LVM physical volume

here is the output of my lsblk..

sda                                                                                       
    |-sda1            xfs                              e86122cd-12b8-418a-af88-213c5f7cf198   /boot
    `-sda2            LVM2_member                      aTcqdV-CreW-yf1R-Et4Z-FXDg-a30f-bTa8ua 
      |-ol-root       xfs                              d3f701f6-bee6-4838-ad23-e004d6477e2a   /
      |-ol-swap       swap                             551085fa-4f56-474a-9fe4-926a50254506   [SWAP]
      `-ol-lv_oradata xfs                              40b962d1-ec00-44a1-8257-42d706c4839f   
    sdb                                                                                       
    `-sdb1            LVM2_member                      Q6IQCo-bR9J-XowP-gYzN-Nvfc-HcTG-UZDlL4 
      `-ol-lv_oradata xfs                              40b962d1-ec00-44a1-8257-42d706c4839f 

Here is the output of pvs, vgs and lvs

pvs
PV         VG Fmt  Attr PSize   PFree 
/dev/sda2  ol lvm2 a--  <29.51g 36.00m
/dev/sdb1  ol lvm2 a--  <50.00g 0

vgs 
VG #PV #LV #SN Attr   VSize  VFree 
ol   2   3   0 wz--n- 79.50g 36.00m

lvs
LV         VG Attr       LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_oradata ol -wi-a----- 50.00g 
root       ol -wi-ao---- <26.47g 
swap       ol -wi-ao---- 3.00g

share|improve this question

  • 1

    After running lvcreate did you run mkfs or similar? If not then it’s just an unformatted volume without a filesystem on it.

    – Stephen Harris
    Jan 3 at 21:11

  • that might be it. i saw that it showed under lsblk but nothing returns for blkid

    – cptkirkh
    Jan 3 at 21:36

  • Tried to run mksf.xfs -f /dev/sdb1 and it fails with cannot open /dev/sdb1: device or resource busy

    – cptkirkh
    Jan 3 at 21:44

  • Was able to run it using the lv path and it worked but still won’t mount.

    – cptkirkh
    Jan 3 at 21:53

  • mksf.xfs -f /dev/sdb1 – NO !!! you’re trying to put a filesystem into the same place as your VG. The LVM layer owns the disks (well, these partitions). Leave them alone.

    – roaima
    Jan 3 at 22:01

4

I am playing around with understanding LVM and adding disks to a Linux box. I added a disk and then ran what I thought were commands to add this disk to the box, but I think I messed up.

Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

mount error..

mount -t xfs /dev/mapper/ol-lv_oradata  /mnt/drives/oradata
mount: wrong fs type, bad option, bad superblock on /dev/mapper/ol-lv_oradata,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

here are my outputs.

df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ol-root   27G   22G  5.1G  81% /
devtmpfs             1.4G     0  1.4G   0% /dev
tmpfs                1.4G   32M  1.4G   3% /dev/shm
tmpfs                1.4G  9.6M  1.4G   1% /run
tmpfs                1.4G     0  1.4G   0% /sys/fs/cgroup
/dev/sda1            497M  282M  216M  57% /boot
tmpfs                276M   60K  276M   1% /run/user/54321


 ls -ls /dev/sd*
0 brw-rw----. 1 root disk 8,  0 Jan  2 16:34 /dev/sda
0 brw-rw----. 1 root disk 8,  1 Jan  2 16:34 /dev/sda1
0 brw-rw----. 1 root disk 8,  2 Jan  3 13:53 /dev/sda2
0 brw-rw----. 1 root disk 8, 16 Jan  3 13:50 /dev/sdb  <-- this is the disk I added
0 brw-rw----. 1 root disk 8, 17 Jan  3 13:53 /dev/sdb1 <-- this is the disk I added

fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 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 label type: dos
Disk identifier: 0x0003e72b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 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 label type: dos
Disk identifier: 0x9a45daa3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   104857599    52427776   83  Linux

Disk /dev/mapper/ol-root: 28.4 GB, 28420603904 bytes, 55508992 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/ol-swap: 3221 MB, 3221225472 bytes, 6291456 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/ol-lv_oradata: 53.7 GB, 53687091200 bytes, 104857600 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

 lvmdiskscan
  /dev/ram0          [      16.00 MiB] 
  /dev/ol/root       [     <26.47 GiB] 
  /dev/ram1          [      16.00 MiB] 
  /dev/sda1          [     500.00 MiB] 
  /dev/ol/swap       [       3.00 GiB] 
  /dev/ram2          [      16.00 MiB] 
  /dev/sda2          [      29.51 GiB] LVM physical volume
  /dev/ol/lv_oradata [      50.00 GiB] 
  /dev/ram3          [      16.00 MiB] 
  /dev/ram4          [      16.00 MiB] 
  /dev/ram5          [      16.00 MiB] 
  /dev/ram6          [      16.00 MiB] 
  /dev/ram7          [      16.00 MiB] 
  /dev/ram8          [      16.00 MiB] 
  /dev/ram9          [      16.00 MiB] 
  /dev/ram10         [      16.00 MiB] 
  /dev/ram11         [      16.00 MiB] 
  /dev/ram12         [      16.00 MiB] 
  /dev/ram13         [      16.00 MiB] 
  /dev/ram14         [      16.00 MiB] 
  /dev/ram15         [      16.00 MiB] 
  /dev/sdb1          [     <50.00 GiB] LVM physical volume

here is the output of my lsblk..

sda                                                                                       
    |-sda1            xfs                              e86122cd-12b8-418a-af88-213c5f7cf198   /boot
    `-sda2            LVM2_member                      aTcqdV-CreW-yf1R-Et4Z-FXDg-a30f-bTa8ua 
      |-ol-root       xfs                              d3f701f6-bee6-4838-ad23-e004d6477e2a   /
      |-ol-swap       swap                             551085fa-4f56-474a-9fe4-926a50254506   [SWAP]
      `-ol-lv_oradata xfs                              40b962d1-ec00-44a1-8257-42d706c4839f   
    sdb                                                                                       
    `-sdb1            LVM2_member                      Q6IQCo-bR9J-XowP-gYzN-Nvfc-HcTG-UZDlL4 
      `-ol-lv_oradata xfs                              40b962d1-ec00-44a1-8257-42d706c4839f 

Here is the output of pvs, vgs and lvs

pvs
PV         VG Fmt  Attr PSize   PFree 
/dev/sda2  ol lvm2 a--  <29.51g 36.00m
/dev/sdb1  ol lvm2 a--  <50.00g 0

vgs 
VG #PV #LV #SN Attr   VSize  VFree 
ol   2   3   0 wz--n- 79.50g 36.00m

lvs
LV         VG Attr       LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_oradata ol -wi-a----- 50.00g 
root       ol -wi-ao---- <26.47g 
swap       ol -wi-ao---- 3.00g

share|improve this question

  • 1

    After running lvcreate did you run mkfs or similar? If not then it’s just an unformatted volume without a filesystem on it.

    – Stephen Harris
    Jan 3 at 21:11

  • that might be it. i saw that it showed under lsblk but nothing returns for blkid

    – cptkirkh
    Jan 3 at 21:36

  • Tried to run mksf.xfs -f /dev/sdb1 and it fails with cannot open /dev/sdb1: device or resource busy

    – cptkirkh
    Jan 3 at 21:44

  • Was able to run it using the lv path and it worked but still won’t mount.

    – cptkirkh
    Jan 3 at 21:53

  • mksf.xfs -f /dev/sdb1 – NO !!! you’re trying to put a filesystem into the same place as your VG. The LVM layer owns the disks (well, these partitions). Leave them alone.

    – roaima
    Jan 3 at 22:01

4

4

4

I am playing around with understanding LVM and adding disks to a Linux box. I added a disk and then ran what I thought were commands to add this disk to the box, but I think I messed up.

Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

mount error..

mount -t xfs /dev/mapper/ol-lv_oradata  /mnt/drives/oradata
mount: wrong fs type, bad option, bad superblock on /dev/mapper/ol-lv_oradata,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

here are my outputs.

df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ol-root   27G   22G  5.1G  81% /
devtmpfs             1.4G     0  1.4G   0% /dev
tmpfs                1.4G   32M  1.4G   3% /dev/shm
tmpfs                1.4G  9.6M  1.4G   1% /run
tmpfs                1.4G     0  1.4G   0% /sys/fs/cgroup
/dev/sda1            497M  282M  216M  57% /boot
tmpfs                276M   60K  276M   1% /run/user/54321


 ls -ls /dev/sd*
0 brw-rw----. 1 root disk 8,  0 Jan  2 16:34 /dev/sda
0 brw-rw----. 1 root disk 8,  1 Jan  2 16:34 /dev/sda1
0 brw-rw----. 1 root disk 8,  2 Jan  3 13:53 /dev/sda2
0 brw-rw----. 1 root disk 8, 16 Jan  3 13:50 /dev/sdb  <-- this is the disk I added
0 brw-rw----. 1 root disk 8, 17 Jan  3 13:53 /dev/sdb1 <-- this is the disk I added

fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 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 label type: dos
Disk identifier: 0x0003e72b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 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 label type: dos
Disk identifier: 0x9a45daa3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   104857599    52427776   83  Linux

Disk /dev/mapper/ol-root: 28.4 GB, 28420603904 bytes, 55508992 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/ol-swap: 3221 MB, 3221225472 bytes, 6291456 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/ol-lv_oradata: 53.7 GB, 53687091200 bytes, 104857600 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

 lvmdiskscan
  /dev/ram0          [      16.00 MiB] 
  /dev/ol/root       [     <26.47 GiB] 
  /dev/ram1          [      16.00 MiB] 
  /dev/sda1          [     500.00 MiB] 
  /dev/ol/swap       [       3.00 GiB] 
  /dev/ram2          [      16.00 MiB] 
  /dev/sda2          [      29.51 GiB] LVM physical volume
  /dev/ol/lv_oradata [      50.00 GiB] 
  /dev/ram3          [      16.00 MiB] 
  /dev/ram4          [      16.00 MiB] 
  /dev/ram5          [      16.00 MiB] 
  /dev/ram6          [      16.00 MiB] 
  /dev/ram7          [      16.00 MiB] 
  /dev/ram8          [      16.00 MiB] 
  /dev/ram9          [      16.00 MiB] 
  /dev/ram10         [      16.00 MiB] 
  /dev/ram11         [      16.00 MiB] 
  /dev/ram12         [      16.00 MiB] 
  /dev/ram13         [      16.00 MiB] 
  /dev/ram14         [      16.00 MiB] 
  /dev/ram15         [      16.00 MiB] 
  /dev/sdb1          [     <50.00 GiB] LVM physical volume

here is the output of my lsblk..

sda                                                                                       
    |-sda1            xfs                              e86122cd-12b8-418a-af88-213c5f7cf198   /boot
    `-sda2            LVM2_member                      aTcqdV-CreW-yf1R-Et4Z-FXDg-a30f-bTa8ua 
      |-ol-root       xfs                              d3f701f6-bee6-4838-ad23-e004d6477e2a   /
      |-ol-swap       swap                             551085fa-4f56-474a-9fe4-926a50254506   [SWAP]
      `-ol-lv_oradata xfs                              40b962d1-ec00-44a1-8257-42d706c4839f   
    sdb                                                                                       
    `-sdb1            LVM2_member                      Q6IQCo-bR9J-XowP-gYzN-Nvfc-HcTG-UZDlL4 
      `-ol-lv_oradata xfs                              40b962d1-ec00-44a1-8257-42d706c4839f 

Here is the output of pvs, vgs and lvs

pvs
PV         VG Fmt  Attr PSize   PFree 
/dev/sda2  ol lvm2 a--  <29.51g 36.00m
/dev/sdb1  ol lvm2 a--  <50.00g 0

vgs 
VG #PV #LV #SN Attr   VSize  VFree 
ol   2   3   0 wz--n- 79.50g 36.00m

lvs
LV         VG Attr       LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_oradata ol -wi-a----- 50.00g 
root       ol -wi-ao---- <26.47g 
swap       ol -wi-ao---- 3.00g

share|improve this question

I am playing around with understanding LVM and adding disks to a Linux box. I added a disk and then ran what I thought were commands to add this disk to the box, but I think I messed up.

Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

mount error..

mount -t xfs /dev/mapper/ol-lv_oradata  /mnt/drives/oradata
mount: wrong fs type, bad option, bad superblock on /dev/mapper/ol-lv_oradata,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

here are my outputs.

df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ol-root   27G   22G  5.1G  81% /
devtmpfs             1.4G     0  1.4G   0% /dev
tmpfs                1.4G   32M  1.4G   3% /dev/shm
tmpfs                1.4G  9.6M  1.4G   1% /run
tmpfs                1.4G     0  1.4G   0% /sys/fs/cgroup
/dev/sda1            497M  282M  216M  57% /boot
tmpfs                276M   60K  276M   1% /run/user/54321


 ls -ls /dev/sd*
0 brw-rw----. 1 root disk 8,  0 Jan  2 16:34 /dev/sda
0 brw-rw----. 1 root disk 8,  1 Jan  2 16:34 /dev/sda1
0 brw-rw----. 1 root disk 8,  2 Jan  3 13:53 /dev/sda2
0 brw-rw----. 1 root disk 8, 16 Jan  3 13:50 /dev/sdb  <-- this is the disk I added
0 brw-rw----. 1 root disk 8, 17 Jan  3 13:53 /dev/sdb1 <-- this is the disk I added

fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 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 label type: dos
Disk identifier: 0x0003e72b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 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 label type: dos
Disk identifier: 0x9a45daa3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   104857599    52427776   83  Linux

Disk /dev/mapper/ol-root: 28.4 GB, 28420603904 bytes, 55508992 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/ol-swap: 3221 MB, 3221225472 bytes, 6291456 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/ol-lv_oradata: 53.7 GB, 53687091200 bytes, 104857600 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

 lvmdiskscan
  /dev/ram0          [      16.00 MiB] 
  /dev/ol/root       [     <26.47 GiB] 
  /dev/ram1          [      16.00 MiB] 
  /dev/sda1          [     500.00 MiB] 
  /dev/ol/swap       [       3.00 GiB] 
  /dev/ram2          [      16.00 MiB] 
  /dev/sda2          [      29.51 GiB] LVM physical volume
  /dev/ol/lv_oradata [      50.00 GiB] 
  /dev/ram3          [      16.00 MiB] 
  /dev/ram4          [      16.00 MiB] 
  /dev/ram5          [      16.00 MiB] 
  /dev/ram6          [      16.00 MiB] 
  /dev/ram7          [      16.00 MiB] 
  /dev/ram8          [      16.00 MiB] 
  /dev/ram9          [      16.00 MiB] 
  /dev/ram10         [      16.00 MiB] 
  /dev/ram11         [      16.00 MiB] 
  /dev/ram12         [      16.00 MiB] 
  /dev/ram13         [      16.00 MiB] 
  /dev/ram14         [      16.00 MiB] 
  /dev/ram15         [      16.00 MiB] 
  /dev/sdb1          [     <50.00 GiB] LVM physical volume

here is the output of my lsblk..

sda                                                                                       
    |-sda1            xfs                              e86122cd-12b8-418a-af88-213c5f7cf198   /boot
    `-sda2            LVM2_member                      aTcqdV-CreW-yf1R-Et4Z-FXDg-a30f-bTa8ua 
      |-ol-root       xfs                              d3f701f6-bee6-4838-ad23-e004d6477e2a   /
      |-ol-swap       swap                             551085fa-4f56-474a-9fe4-926a50254506   [SWAP]
      `-ol-lv_oradata xfs                              40b962d1-ec00-44a1-8257-42d706c4839f   
    sdb                                                                                       
    `-sdb1            LVM2_member                      Q6IQCo-bR9J-XowP-gYzN-Nvfc-HcTG-UZDlL4 
      `-ol-lv_oradata xfs                              40b962d1-ec00-44a1-8257-42d706c4839f 

Here is the output of pvs, vgs and lvs

pvs
PV         VG Fmt  Attr PSize   PFree 
/dev/sda2  ol lvm2 a--  <29.51g 36.00m
/dev/sdb1  ol lvm2 a--  <50.00g 0

vgs 
VG #PV #LV #SN Attr   VSize  VFree 
ol   2   3   0 wz--n- 79.50g 36.00m

lvs
LV         VG Attr       LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_oradata ol -wi-a----- 50.00g 
root       ol -wi-ao---- <26.47g 
swap       ol -wi-ao---- 3.00g

linux lvm

share|improve this question

share|improve this question

share|improve this question

share|improve this question

edited Jan 4 at 20:02

roaima

43.3k553116

43.3k553116

asked Jan 3 at 20:57

cptkirkhcptkirkh

212

212

  • 1

    After running lvcreate did you run mkfs or similar? If not then it’s just an unformatted volume without a filesystem on it.

    – Stephen Harris
    Jan 3 at 21:11

  • that might be it. i saw that it showed under lsblk but nothing returns for blkid

    – cptkirkh
    Jan 3 at 21:36

  • Tried to run mksf.xfs -f /dev/sdb1 and it fails with cannot open /dev/sdb1: device or resource busy

    – cptkirkh
    Jan 3 at 21:44

  • Was able to run it using the lv path and it worked but still won’t mount.

    – cptkirkh
    Jan 3 at 21:53

  • mksf.xfs -f /dev/sdb1 – NO !!! you’re trying to put a filesystem into the same place as your VG. The LVM layer owns the disks (well, these partitions). Leave them alone.

    – roaima
    Jan 3 at 22:01

  • 1

    After running lvcreate did you run mkfs or similar? If not then it’s just an unformatted volume without a filesystem on it.

    – Stephen Harris
    Jan 3 at 21:11

  • that might be it. i saw that it showed under lsblk but nothing returns for blkid

    – cptkirkh
    Jan 3 at 21:36

  • Tried to run mksf.xfs -f /dev/sdb1 and it fails with cannot open /dev/sdb1: device or resource busy

    – cptkirkh
    Jan 3 at 21:44

  • Was able to run it using the lv path and it worked but still won’t mount.

    – cptkirkh
    Jan 3 at 21:53

  • mksf.xfs -f /dev/sdb1 – NO !!! you’re trying to put a filesystem into the same place as your VG. The LVM layer owns the disks (well, these partitions). Leave them alone.

    – roaima
    Jan 3 at 22:01

1

1

After running lvcreate did you run mkfs or similar? If not then it’s just an unformatted volume without a filesystem on it.

– Stephen Harris
Jan 3 at 21:11

After running lvcreate did you run mkfs or similar? If not then it’s just an unformatted volume without a filesystem on it.

– Stephen Harris
Jan 3 at 21:11

that might be it. i saw that it showed under lsblk but nothing returns for blkid

– cptkirkh
Jan 3 at 21:36

that might be it. i saw that it showed under lsblk but nothing returns for blkid

– cptkirkh
Jan 3 at 21:36

Tried to run mksf.xfs -f /dev/sdb1 and it fails with cannot open /dev/sdb1: device or resource busy

– cptkirkh
Jan 3 at 21:44

Tried to run mksf.xfs -f /dev/sdb1 and it fails with cannot open /dev/sdb1: device or resource busy

– cptkirkh
Jan 3 at 21:44

Was able to run it using the lv path and it worked but still won’t mount.

– cptkirkh
Jan 3 at 21:53

Was able to run it using the lv path and it worked but still won’t mount.

– cptkirkh
Jan 3 at 21:53

mksf.xfs -f /dev/sdb1 – NO !!! you’re trying to put a filesystem into the same place as your VG. The LVM layer owns the disks (well, these partitions). Leave them alone.

– roaima
Jan 3 at 22:01

mksf.xfs -f /dev/sdb1 – NO !!! you’re trying to put a filesystem into the same place as your VG. The LVM layer owns the disks (well, these partitions). Leave them alone.

– roaima
Jan 3 at 22:01

2 Answers
2

active

oldest

votes

2

Q : Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

A : If you want to extend you current LVM with new disk, first you need to create partition on new disk like @roaima already mention before then extend the current volume group of your LVM and then extend your LVM disk.

Reference :

A Linux user’s guide to Logical Volume Management

How to Extend/Reduce LVM’s (Logical Volume Management) in Linux

share|improve this answer

    0

    The output of pvs shows that you have two physical partitions assigned to your volume group ol. The output of lvs shows that you have three logical volumes in that volume group.

    Your first mount attempt was accurate, so I suspect you hadn’t formatted it.

    mkfs -t xfs /dev/mapper/ol-lv_oradata
    mount -t xfs /dev/mapper/ol-lv_oradata /mnt/drives/oradata
    

    As an aside since you’re learning about LVM, be aware that if you lose either of your disks you may well lose everything in the volume group that spans them. (Read up on the perils of “RAID 0” disk configurations for some detail. Your VG is configured in much the same way.)

    share|improve this answer

    • Thanks to @roaima I was able to understand that I needed to do a little more reading. I now understand physical and logical volumes along with volume groups. like i said this is just a test server to teach me on how it works.

      – cptkirkh
      Jan 4 at 20:25

    Your Answer

    StackExchange.ready(function() {
    var channelOptions = {
    tags: “”.split(” “),
    id: “106”
    };
    initTagRenderer(“”.split(” “), “”.split(” “), channelOptions);

    StackExchange.using(“externalEditor”, function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using(“snippets”, function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: ‘answer’,
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: “”,
    imageUploader: {
    brandingHtml: “Powered by u003ca class=”icon-imgur-white” href=”https://imgur.com/”u003eu003c/au003e”,
    contentPolicyHtml: “User contributions licensed under u003ca href=”https://creativecommons.org/licenses/by-sa/3.0/”u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href=”https://stackoverflow.com/legal/content-policy”u003e(content policy)u003c/au003e”,
    allowUrls: true
    },
    onDemand: true,
    discardSelector: “.discard-answer”
    ,immediatelyShowMarkdownHelp:true
    });

    }
    });

    draft saved
    draft discarded

    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin(‘.new-post-login’, ‘https%3a%2f%2funix.stackexchange.com%2fquestions%2f492334%2fhow-to-better-understand-lvm-and-adding-disks%23new-answer’, ‘question_page’);
    }
    );

    Post as a guest

    Required, but never shown

    2 Answers
    2

    active

    oldest

    votes

    2 Answers
    2

    active

    oldest

    votes

    active

    oldest

    votes

    active

    oldest

    votes

    2

    Q : Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

    A : If you want to extend you current LVM with new disk, first you need to create partition on new disk like @roaima already mention before then extend the current volume group of your LVM and then extend your LVM disk.

    Reference :

    A Linux user’s guide to Logical Volume Management

    How to Extend/Reduce LVM’s (Logical Volume Management) in Linux

    share|improve this answer

      2

      Q : Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

      A : If you want to extend you current LVM with new disk, first you need to create partition on new disk like @roaima already mention before then extend the current volume group of your LVM and then extend your LVM disk.

      Reference :

      A Linux user’s guide to Logical Volume Management

      How to Extend/Reduce LVM’s (Logical Volume Management) in Linux

      share|improve this answer

        2

        2

        2

        Q : Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

        A : If you want to extend you current LVM with new disk, first you need to create partition on new disk like @roaima already mention before then extend the current volume group of your LVM and then extend your LVM disk.

        Reference :

        A Linux user’s guide to Logical Volume Management

        How to Extend/Reduce LVM’s (Logical Volume Management) in Linux

        share|improve this answer

        Q : Did I just add this disk to the current LV and now I just need to resize it? I tried to get this to mount but it comes back with the following error.

        A : If you want to extend you current LVM with new disk, first you need to create partition on new disk like @roaima already mention before then extend the current volume group of your LVM and then extend your LVM disk.

        Reference :

        A Linux user’s guide to Logical Volume Management

        How to Extend/Reduce LVM’s (Logical Volume Management) in Linux

        share|improve this answer

        share|improve this answer

        share|improve this answer

        edited Jan 4 at 19:46

        Rui F Ribeiro

        39.5k1479132

        39.5k1479132

        answered Jan 4 at 6:13

        Iyus Dedi PutraIyus Dedi Putra

        486

        486

            0

            The output of pvs shows that you have two physical partitions assigned to your volume group ol. The output of lvs shows that you have three logical volumes in that volume group.

            Your first mount attempt was accurate, so I suspect you hadn’t formatted it.

            mkfs -t xfs /dev/mapper/ol-lv_oradata
            mount -t xfs /dev/mapper/ol-lv_oradata /mnt/drives/oradata
            

            As an aside since you’re learning about LVM, be aware that if you lose either of your disks you may well lose everything in the volume group that spans them. (Read up on the perils of “RAID 0” disk configurations for some detail. Your VG is configured in much the same way.)

            share|improve this answer

            • Thanks to @roaima I was able to understand that I needed to do a little more reading. I now understand physical and logical volumes along with volume groups. like i said this is just a test server to teach me on how it works.

              – cptkirkh
              Jan 4 at 20:25

            0

            The output of pvs shows that you have two physical partitions assigned to your volume group ol. The output of lvs shows that you have three logical volumes in that volume group.

            Your first mount attempt was accurate, so I suspect you hadn’t formatted it.

            mkfs -t xfs /dev/mapper/ol-lv_oradata
            mount -t xfs /dev/mapper/ol-lv_oradata /mnt/drives/oradata
            

            As an aside since you’re learning about LVM, be aware that if you lose either of your disks you may well lose everything in the volume group that spans them. (Read up on the perils of “RAID 0” disk configurations for some detail. Your VG is configured in much the same way.)

            share|improve this answer

            • Thanks to @roaima I was able to understand that I needed to do a little more reading. I now understand physical and logical volumes along with volume groups. like i said this is just a test server to teach me on how it works.

              – cptkirkh
              Jan 4 at 20:25

            0

            0

            0

            The output of pvs shows that you have two physical partitions assigned to your volume group ol. The output of lvs shows that you have three logical volumes in that volume group.

            Your first mount attempt was accurate, so I suspect you hadn’t formatted it.

            mkfs -t xfs /dev/mapper/ol-lv_oradata
            mount -t xfs /dev/mapper/ol-lv_oradata /mnt/drives/oradata
            

            As an aside since you’re learning about LVM, be aware that if you lose either of your disks you may well lose everything in the volume group that spans them. (Read up on the perils of “RAID 0” disk configurations for some detail. Your VG is configured in much the same way.)

            share|improve this answer

            The output of pvs shows that you have two physical partitions assigned to your volume group ol. The output of lvs shows that you have three logical volumes in that volume group.

            Your first mount attempt was accurate, so I suspect you hadn’t formatted it.

            mkfs -t xfs /dev/mapper/ol-lv_oradata
            mount -t xfs /dev/mapper/ol-lv_oradata /mnt/drives/oradata
            

            As an aside since you’re learning about LVM, be aware that if you lose either of your disks you may well lose everything in the volume group that spans them. (Read up on the perils of “RAID 0” disk configurations for some detail. Your VG is configured in much the same way.)

            share|improve this answer

            share|improve this answer

            share|improve this answer

            answered Jan 4 at 20:05

            roaimaroaima

            43.3k553116

            43.3k553116

            • Thanks to @roaima I was able to understand that I needed to do a little more reading. I now understand physical and logical volumes along with volume groups. like i said this is just a test server to teach me on how it works.

              – cptkirkh
              Jan 4 at 20:25

            • Thanks to @roaima I was able to understand that I needed to do a little more reading. I now understand physical and logical volumes along with volume groups. like i said this is just a test server to teach me on how it works.

              – cptkirkh
              Jan 4 at 20:25

            Thanks to @roaima I was able to understand that I needed to do a little more reading. I now understand physical and logical volumes along with volume groups. like i said this is just a test server to teach me on how it works.

            – cptkirkh
            Jan 4 at 20:25

            Thanks to @roaima I was able to understand that I needed to do a little more reading. I now understand physical and logical volumes along with volume groups. like i said this is just a test server to teach me on how it works.

            – cptkirkh
            Jan 4 at 20:25

            draft saved
            draft discarded

            Thanks for contributing an answer to Unix & Linux Stack Exchange!

            • Please be sure to answer the question. Provide details and share your research!

            But avoid

            • Asking for help, clarification, or responding to other answers.
            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.

            draft saved

            draft discarded

            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin(‘.new-post-login’, ‘https%3a%2f%2funix.stackexchange.com%2fquestions%2f492334%2fhow-to-better-understand-lvm-and-adding-disks%23new-answer’, ‘question_page’);
            }
            );

            Post as a guest

            Required, but never shown

            Required, but never shown

            Required, but never shown

            Required, but never shown

            Required, but never shown

            Required, but never shown

            Required, but never shown

            Required, but never shown

            Required, but never shown

            Related Post

            Leave a Reply

            Your email address will not be published. Required fields are marked *