LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LVM mount via USB (https://www.linuxquestions.org/questions/linux-newbie-8/lvm-mount-via-usb-4175530567/)

rizean 01-09-2015 02:57 PM

LVM mount via USB
 
My father passed away about 6 months ago and I'm just getting around to going threw all 18 hard drives... I have been using Ubuntu 14.04 for over a year now and while I'm not a pro I can handle most things.

One drive has LVM on it. I have attached it via a USB2.0 to SATA cable. I followed the instructions here: http://linuxers.org/howto/how-mount-...rtitions-linux

Code:

michael [ ~ ]$ sudo fdisk -l
[sudo] password for michael:

Disk /dev/sda: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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 identifier: 0x38431b10

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1            2048  1464322047  732160000    7  HPFS/NTFS/exFAT
/dev/sda2      1464322048  2930272255  732975104    7  HPFS/NTFS/exFAT

Disk /dev/sdb: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 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 identifier: 0x000656a3

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048    33560575    16779264  82  Linux swap / Solaris
/dev/sdb2  *    33560576    75505663    20972544  83  Linux
/dev/sdb3        75505664  500117503  212305920  83  Linux

Disk /dev/sdc: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 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 identifier: 0x000da346

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1  *        2048      499711      248832  83  Linux
/dev/sdc2          501758  1465147391  732322817    5  Extended
/dev/sdc5          501760  1465147391  732322816  8e  Linux LVM
michael [ ~ ]$ sudo pvs
  PV        VG        Fmt  Attr PSize  PFree
  /dev/sdc5  ubuntu1-vg lvm2 a--  698.39g    0
michael [ ~ ]$ sudo lvdisplay /dev/ubuntu1-vg
  --- Logical volume ---
  LV Path                /dev/ubuntu1-vg/root
  LV Name                root
  VG Name                ubuntu1-vg
  LV UUID                StErnb-Mtop-NaEy-faw4-wNk0-bY5I-6ARBmI
  LV Write Access        read/write
  LV Creation host, time ubuntu1, 2014-08-12 18:45:21 +0900
  LV Status              NOT available
  LV Size                694.39 GiB
  Current LE            177765
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
 
  --- Logical volume ---
  LV Path                /dev/ubuntu1-vg/swap_1
  LV Name                swap_1
  VG Name                ubuntu1-vg
  LV UUID                62DxMC-qLAo-6cU9-kA5H-kNoL-7B4t-1ZCQcK
  LV Write Access        read/write
  LV Creation host, time ubuntu1, 2014-08-12 18:45:21 +0900
  LV Status              NOT available
  LV Size                4.00 GiB
  Current LE            1024
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
 
michael [ ~ ]$ mount /dev/ubuntu1-vg/root /mnt
mount: only root can do that
michael [ ~ ]$ sudo mount /dev/ubuntu1-vg/root /mnt
mount: special device /dev/ubuntu1-vg/root does not exist

So where did I go wrong?

rknichols 01-09-2015 04:39 PM

Quote:

Originally Posted by rizean (Post 5298379)
Code:

michael [ ~ ]$ sudo lvdisplay /dev/ubuntu1-vg
  --- Logical volume ---
  LV Path                /dev/ubuntu1-vg/root
  LV Name                root
  VG Name                ubuntu1-vg
  LV UUID                StErnb-Mtop-NaEy-faw4-wNk0-bY5I-6ARBmI
  LV Write Access        read/write
  LV Creation host, time ubuntu1, 2014-08-12 18:45:21 +0900
  LV Status              NOT available
  LV Size                694.39 GiB
  Current LE            177765
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
 ...
michael [ ~ ]$ sudo mount /dev/ubuntu1-vg/root /mnt
mount: special device /dev/ubuntu1-vg/root does not exist

So where did I go wrong?

Presumably, you need to activate that LV:
Code:

lvchange -ay /dev/ubuntu1-vg/root

JeremyBoden 01-09-2015 07:36 PM

You can enter
Code:

sudo lvm
to enter LVM commands. Type help to get a list of all commands, quit to leave the command environment.
Code:

lvm> help
  Available lvm commands:
  Use 'lvm help <command>' for more information
 
  dumpconfig      Dump active configuration
  formats        List available metadata formats
  help            Display help for commands
  lvchange        Change the attributes of logical volume(s)
  lvconvert      Change logical volume layout
  lvcreate        Create a logical volume
  lvdisplay      Display information about a logical volume
  lvextend        Add space to a logical volume
  lvmchange      With the device mapper, this is obsolete and does nothing.
  lvmdiskscan    List devices that may be used as physical volumes
  lvmsadc        Collect activity data
  lvmsar          Create activity report
  lvreduce        Reduce the size of a logical volume
  lvremove        Remove logical volume(s) from the system
  lvrename        Rename a logical volume
  lvresize        Resize a logical volume
  lvs            Display information about logical volumes
  lvscan          List all logical volumes in all volume groups
  pvchange        Change attributes of physical volume(s)
  pvresize        Resize physical volume(s)
  pvck            Check the consistency of physical volume(s)
  pvcreate        Initialize physical volume(s) for use by LVM
  pvdata          Display the on-disk metadata for physical volume(s)
  pvdisplay      Display various attributes of physical volume(s)
  pvmove          Move extents from one physical volume to another
  pvremove        Remove LVM label(s) from physical volume(s)
  pvs            Display information about physical volumes
  pvscan          List all physical volumes
  segtypes        List available segment types
  vgcfgbackup    Backup volume group configuration(s)
  vgcfgrestore    Restore volume group configuration
  vgchange        Change volume group attributes
  vgck            Check the consistency of volume group(s)
  vgconvert      Change volume group metadata format
  vgcreate        Create a volume group
  vgdisplay      Display volume group information
  vgexport        Unregister volume group(s) from the system
  vgextend        Add physical volumes to a volume group
  vgimport        Register exported volume group with system
  vgmerge        Merge volume groups
  vgmknodes      Create the special files for volume group devices in /dev
  vgreduce        Remove physical volume(s) from a volume group
  vgremove        Remove volume group(s)
  vgrename        Rename a volume group
  vgs            Display information about volume groups
  vgscan          Search for all volume groups
  vgsplit        Move physical volumes into a new or existing volume group
  version        Display software and driver version information
lvm> quit
  Exiting.


rizean 01-10-2015 06:53 PM

Quote:

Originally Posted by rknichols (Post 5298414)
Presumably, you need to activate that LV:
Code:

lvchange -ay /dev/ubuntu1-vg/root


Thanks this work!

rknichols 01-10-2015 07:45 PM

Quote:

Originally Posted by rizean (Post 5298892)
Thanks this work!

Please use the thread tools at the top to mark this SOLVED. Oops, now I see you did.


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