LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-04-2016, 08:47 AM   #1
lithrandir
LQ Newbie
 
Registered: Sep 2016
Posts: 2

Rep: Reputation: Disabled
Hard drive not mounting


Hi,

We have a Linux system on our computer, which had a hard drive (sdb1) placed by a colleague. We need to retrieve the files in that hard drive, but unfortunately the Linux system doesn't seem to mount it properly (?) It doesn't seem to recognize its file system.

Code:
-bash-4.1$ lsblk
NAME                          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb                             8:16   0 278.5G  0 disk 
└─sdb1                          8:17   0 278.5G  0 part 
sda                             8:0    0 278.5G  0 disk 
├─sda1                          8:1    0   200M  0 part /boot/efi
├─sda2                          8:2    0   500M  0 part /boot
└─sda3                          8:3    0 277.8G  0 part 
  ├─vg_nj1-lv_root (dm-0) 253:0    0    50G  0 lvm  /
  ├─vg_nj1-lv_swap (dm-1) 253:1    0   3.8G  0 lvm  [SWAP]
  └─vg_nj1-lv_home (dm-2) 253:2    0   224G  0 lvm  /home
sr0                            11:0    1  1024M  0 rom  

fdisk -l

Disk /dev/sdb: 299.0 GB, 298999349248 bytes
255 heads, 63 sectors/track, 36351 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003e75a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       36351   291989376   8e  Linux LVM

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 299.0 GB, 298999349248 bytes
255 heads, 63 sectors/track, 36351 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       36352   291991551+  ee  GPT

Disk /dev/mapper/vg_nj1-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_nj1-lv_swap: 4110 MB, 4110417920 bytes
255 heads, 63 sectors/track, 499 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_nj1-lv_home: 240.5 GB, 240463642624 bytes
255 heads, 63 sectors/track, 29234 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Thanks.

Last edited by onebuck; 09-04-2016 at 09:22 AM. Reason: clean up, code tags to ease reading of post
 
Old 09-04-2016, 09:24 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
You haven't shown any errors to support the OS doesn't mount the LVMs properly on boot. So boot the machine, become root, then check 'dmesg' output and system logs for clues then try 'vgscan; vgchange -ay; dmsetup status;'?
 
Old 09-04-2016, 10:32 PM   #3
lithrandir
LQ Newbie
 
Registered: Sep 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
You haven't shown any errors to support the OS doesn't mount the LVMs properly on boot. So boot the machine, become root, then check 'dmesg' output and system logs for clues then try 'vgscan; vgchange -ay; dmsetup status;'?
I've done su, the lsblk shows the same for sdb. How do I mount sdb and check its content? Sorry, I'm new to this. Below are the outputs from several commands:

[root@nj1 CgWi]# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 278.5G 0 disk
└─sdb1 8:17 0 278.5G 0 part
sda 8:0 0 278.5G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 500M 0 part /boot
└─sda3 8:3 0 277.8G 0 part
├─vg_njuhep1-lv_root (dm-0) 253:0 0 50G 0 lvm /
├─vg_njuhep1-lv_swap (dm-1) 253:1 0 3.8G 0 lvm [SWAP]
└─vg_njuhep1-lv_home (dm-2) 253:2 0 224G 0 lvm /home
sr0 11:0 1 1024M 0 rom


[root@nj1 CgWi]# dmesg | grep sdb
sd 0:2:1:0: [sdb] 583983104 512-byte logical blocks: (298 GB/278 GiB)
sd 0:2:1:0: [sdb] Write Protect is off
sd 0:2:1:0: [sdb] Mode Sense: 1f 00 10 08
sd 0:2:1:0: [sdb] Write cache: disabled, read cache: enabled, supports DPO and FUA
sdb:
sda: sdb1
sd 0:2:1:0: [sdb] Attached SCSI disk

[root@nj1 CgWi]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg_nj1" using metadata type lvm2


[root@nj1 CgWi]# vgchange -ay
3 logical volume(s) in volume group "vg_nj1" now active


[root@nj1 CgWi]# dmsetup status
vg_nj1-lv_home: 0 469655552 linear
vg_nj1-lv_swap: 0 8028160 linear
vg_nj1-lv_root: 0 104857600 linear
 
Old 09-04-2016, 11:28 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
I wonder if sdb has a vg of the same name - check dmesg (unfiltered) after the vgchange.
 
Old 09-05-2016, 01:34 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by lithrandir View Post
(..)
Code:
  ├─vg_njuhep1-lv_root (dm-0) 253:0    0    50G  0 lvm  /
  ├─vg_njuhep1-lv_swap (dm-1) 253:1    0   3.8G  0 lvm  [SWAP]
  └─vg_njuhep1-lv_home (dm-2) 253:2    0   224G  0 lvm  /home

(..)

[root@nj1 CgWi]# dmsetup status
vg_nj1-lv_home: 0 469655552 linear 
vg_nj1-lv_swap: 0 8028160 linear 
vg_nj1-lv_root: 0 104857600 linear
...shows the devices active and ready, now you mount them. *If not done already so: check output of the "mount;" command first! For example "/proc/dm-2" equals "/dev/mapper/vg_nj1-lv_home" so you can mount either manually ("mount /dev/mapper/vg_nj1-lv_home -t auto /home;") or put the stanzas in /etc/fstab. **The latter goes esp. for "/" (dm-0) as you can't do that once you've entered the OS.
 
  


Reply



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
Mounting New Hard Drive MONKEYJUDO Linux - Newbie 9 08-01-2008 01:26 AM
Help on mounting Hard Disk Drive and CD-ROM drive in Dapper. ussr_1991 Ubuntu 2 08-18-2007 11:33 PM
Need help mounting a hard drive cevilgenius Linux - Newbie 15 04-12-2005 02:35 PM
mounting hard drive thug_poet22 Linux - Hardware 14 01-04-2005 02:11 AM
mounting a hard drive n_ick2000 Linux - Newbie 5 04-10-2002 04:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:45 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