Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mounting a hard drive that has no fs. [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
todd93
Guru
Guru


Joined: 30 Oct 2006
Posts: 524
Location: Missouri

PostPosted: Sun Dec 02, 2018 6:52 pm    Post subject: Mounting a hard drive that has no fs. [SOLVED] Reply with quote

I have a weird problem. A few years ago I switched to Ubuntu, installed it with no problem. With my new machine, I decided to go back to Gentoo, so I installed it on a different HD. When looking at my hard drive configuration for fstab, I discovered that the Ubuntu drive that I want to mount and use reports to not have a file system. Has anyone encountered this? I honestly don't understand how that's even possible.

Thanks
Todd


Last edited by todd93 on Sun Dec 02, 2018 11:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43399
Location: 56N 3W

PostPosted: Sun Dec 02, 2018 7:04 pm    Post subject: Reply with quote

todd93,

There is a subtle difference between mounting a drive and mounting a partition on the drive.

With floppies and old USB sticks, you mount the whole thing. There are no partitions.
While you can set up a HDD this way, with no partitions, it would be very unusual, rather than wrong.

What does
Code:
fdisk -l /dev/sd?
have to say?
The ? is a wildcard that matches exactly one symbol.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7133
Location: Saint Amant, Acadiana

PostPosted: Sun Dec 02, 2018 7:43 pm    Post subject: Reply with quote

Code:
# fdisk -l /dev/sdb
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST31000524AS   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

^^ No filesystem? But wait, there's more ...
Code:
# file -s /dev/sdb
/dev/sdb: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)

:wink:
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
todd93
Guru
Guru


Joined: 30 Oct 2006
Posts: 524
Location: Missouri

PostPosted: Sun Dec 02, 2018 8:17 pm    Post subject: Reply with quote

NeddySeagoon, and Jaglover,

The output of fdisk - l /dev/sdb3 is as follows:
Code:
# fdisk -l /dev/sdb3
Disk /dev/sdb3: 930.8 GiB, 999410368512 bytes, 1951973376 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


However, looking at the command that Jaglover suggested, I get:
Code:
# file -s /dev/sdb3
/dev/sdb3: LVM2 PV (Linux Logical Volume Manager), UUID: 4p43Sh-sdQt-uA0O-Ldp2-Z5WA-hoqU-XXF9i4, size: 999410368512


I assume that the file system is LVM2? If so, is it mountable?

Thanks
Todd
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1419
Location: Frankfurt, Germany

PostPosted: Sun Dec 02, 2018 8:20 pm    Post subject: Reply with quote

todd93: please show us the output of ' fdisk -l /dev/sdb' (without 3) and of 'file -s /dev/sdb'
Back to top
View user's profile Send private message
todd93
Guru
Guru


Joined: 30 Oct 2006
Posts: 524
Location: Missouri

PostPosted: Sun Dec 02, 2018 8:23 pm    Post subject: Reply with quote

mike155 wrote:
todd93: please show us the output of ' fdisk -l /dev/sdb' (without 3) and of 'file -s /dev/sdb'


Sorry, here it is:
Code:
# fdisk -l /dev/sdb
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 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
Disklabel type: gpt
Disk identifier: E1179DCB-82FC-41F7-8033-8B42B297B9AA

Device       Start        End    Sectors   Size Type
/dev/sdb1     2048    1050623    1048576   512M EFI Syste
/dev/sdb2  1050624    1550335     499712   244M Linux fil
/dev/sdb3  1550336 1953523711 1951973376 930.8G Linux LVM
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43399
Location: 56N 3W

PostPosted: Sun Dec 02, 2018 8:55 pm    Post subject: Reply with quote

todd93,

You have 3 partitions.
Code:
Device       Start        End    Sectors   Size Type
/dev/sdb1     2048    1050623    1048576   512M EFI Syste

That will be vfat. If your kernel has vfat support.
Code:
mount /dev/sdb1 /mnt/someplace

/dev/sdb2 might be swap. If so,
Code:
swapon /dev/sdb2
will let use use it.
The command will fail if its not swap.

Code:
Device       Start        End    Sectors   Size Type
/dev/sdb3  1550336 1953523711 1951973376 930.8G Linux LVM


sdb3 is a logical volume manager volume, or possibly a piece of one.
You don't mount it. LVM is another abstraction layer. Its lets you do all sorts of useful things you don't care about right now.

You need kernel support for LVM anh a user space tool lvm2.
Once you have that, you need to make the volume group active, so you can see inside.
Code:
vgchange -ay
does that.
Now you can look at /dev/mapper and mount the logical volumes listed there.

Code:
$ ls /dev/mapper
control               host-root          Pi3_64-src       static-usr
guests-bluetest       host-swap          Pi3_64-swap      static-var
guests-dmz--test      host-tmp           Pi3_64-tmp       vg-distfiles
guests-mail           host-usr           ssd-olde--local  vg-home
guests-master         host-var           ssd-olde--root   vg-local
guests-media--server  Pi3_64-buildspace  ssd-olde--usr    vg-opt
guests-router         Pi3_64-distfiles   ssd-olde--var    vg-packages
guests-web--server    Pi3_64-home        static-local     vg-portage
host-distfiles        Pi3_64-opt         static-opt       vg-tmp
host-packages         Pi3_64-packages    static-portage   vg-usr
host-portage          Pi3_64-portage     static-root      vg-var


The part before the hyphen is the volume group name. The part after is the logical volume name within the volume group.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
todd93
Guru
Guru


Joined: 30 Oct 2006
Posts: 524
Location: Missouri

PostPosted: Sun Dec 02, 2018 10:47 pm    Post subject: Reply with quote

NeddySeagoon,

OK, that did it!
Code:
vgchange -ay


Worked perfectly! One question, will I need to run that command after every reboot if I want to get into the LVM drive?

Thanks

Todd
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43399
Location: 56N 3W

PostPosted: Sun Dec 02, 2018 10:58 pm    Post subject: Reply with quote

todd93,

Yes, unless you automate it.
I have root in LVM over raid5 so my initrd does all that.

Hint: There is a lvm service.

Then you can add your logical volumes to /etc/fstab so that the localmount service mounts them.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum