LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-07-2020, 06:47 AM   #1
linuxUser247
Member
 
Registered: Jan 2019
Posts: 80

Rep: Reputation: Disabled
need help mounting my LVM volume


I set up a LVM volume on an external hard drive. I mounted this drive to another machine. Here is what it looks like:

Code:
  --- Physical volume ---
  PV Name               /dev/sda1
  VG Name               vg-main
  PV Size               931.48 GiB / not usable 3.98 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              238458
  Free PE               235898
  Allocated PE          2560
  PV UUID               87oFY6-8MaZ-pQ98-ncMV-Swh3-nOBm-om3MTf
   
  --- Physical Segments ---
  Physical extent 0 to 2559:
    Logical volume	/dev/vg-main/data
    Logical extents	0 to 2559
  Physical extent 2560 to 238457:
    FREE
Code:
lsblk
NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0               7:0    0  45.5M  1 loop /snap/core18/1706
loop1               7:1    0  22.4M  1 loop /snap/snapd/7266
loop2               7:2    0  45.5M  1 loop /snap/core18/1751
loop3               7:3    0  54.2M  1 loop /snap/lxd/14807
loop4               7:4    0  54.3M  1 loop /snap/lxd/15362
loop5               7:5    0    25M  1 loop /snap/snapd/7779
sda                 8:0    0 931.5G  0 disk 
└─sda1              8:1    0 931.5G  0 part 
  └─vg--main-data 253:0    0    10G  0 lvm  
mmcblk0           179:0    0  14.5G  0 disk 
├─mmcblk0p1       179:1    0   256M  0 part /boot/firmware
└─mmcblk0p2       179:2    0  14.3G  0 part /
it is currently not mounted:

Code:
df -h /opt
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2   14G  2.2G   12G  16% /
I would normally mount it like this:

Code:
sudo mount /dev/vg-main/data /opt
the command executes silently. The results are unimpressive:

Code:
df -h /opt
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2   14G  2.2G   12G  16% /
I cannot mount the device directly:

Code:
sudo mount /dev/sda1 /opt
mount: /opt: unknown filesystem type 'LVM2_member'.
which makes sense, because there's no filesystem on sda1.

somehow I don't see what I did wrong, I am not using LVMs a lot so I am probably missing something stupid

Last edited by linuxUser247; 06-07-2020 at 06:52 AM.
 
Old 06-07-2020, 07:40 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,774

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by linuxUser247 View Post
I would normally mount it like this:

Code:
sudo mount /dev/vg-main/data /opt
the command executes silently. The results are unimpressive:

Code:
df -h /opt
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2   14G  2.2G   12G  16% /
Strange that the mount command apparently failed silently. Try that with the "-v" option:
Code:
sudo mount -v /dev/vg-main/data /opt
Also, what is the output when you run the "lvs" command?
 
1 members found this post helpful.
Old 06-07-2020, 08:07 AM   #3
linuxUser247
Member
 
Registered: Jan 2019
Posts: 80

Original Poster
Rep: Reputation: Disabled
thank you for your help . Here are the results:


Code:
sudo mount -v /dev/vg-main/data /opt
mount: /dev/mapper/vg--main-data mounted on /opt.
Code:
df -h /opt 
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2   14G  2.2G   12G  17% /
/dev/mmcblk0p2 is the system drive, expected would be /dev/sda1


Code:
sudo lvs
  LV    VG      Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data  vg-main -wi-a----- 10.00g                                                    
  data2 vg-main -wi-a----- 20.00g
meanwhile, I created another logical volume, data2, to get my system running...
 
Old 06-07-2020, 08:17 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Before mounting, try
Code:
sudo lvchange -ay vg-main/data
 
Old 06-07-2020, 08:17 AM   #5
linuxUser247
Member
 
Registered: Jan 2019
Posts: 80

Original Poster
Rep: Reputation: Disabled
big news, I am able to mount the volume to /mnt/data:

Code:
df -h /mnt/data
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/vg--main-data  9.8G  435M  8.9G   5% /mnt/data

now, mounting on /opt doesn't work because...

Code:
ls -la /opt
total 8
drwxr-xr-x  2 root root 4096 Apr 23 15:02 .
drwxr-xr-x 20 root root 4096 Jun  7 12:49 ..
 
Old 06-07-2020, 03:39 PM   #6
linuxUser247
Member
 
Registered: Jan 2019
Posts: 80

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linuxUser247 View Post
big news, I am able to mount the volume to /mnt/data:

now, mounting on /opt doesn't work because...
I was finally able to solve my issue:

Code:
sudo rmdir /opt
sudo mkdir /opt
sudo mount /dev/vg-main/data /opt
Done, all my problems solved!!! As of why this is, I HAVE NO FREEKIN IDEA. Linux just makes my live hell, I don't know what I did to it to deserve that
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 07:02 AM
[SOLVED] LVM, Expanded the size of my physical volume, how do I expand the volume group? pyr Linux - General 2 09-15-2013 05:28 AM
Extended LVM Volume group and Logical Volume. But space not usable linuxlover.chaitanya Linux - Server 1 11-19-2012 09:37 AM
can't recover LVM volume: Please specify a *single* volume group to restore SoftDux Linux - General 1 08-04-2011 03:31 PM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration