Hard drive won't mount
Solution 1
New hard drives need to have a new partition created on them so that they can be used. I recommend using gparted
. To install the program, type in the following from a terminal window:
sudo apt install gparted
Then gparted
needs to be ran with elevated permissions:
sudo gparted
After your drive is configured, now you need to mount it somewhere. If you want it accessible, you need to create a mount point on your computer for it first. From the terminal window type in the following to create the mount point:
sudo mkdir -p /media/datadrive
we are just going to use datadrive
as the example for the mount point.
Next, we need to get the UUID of the drive so we can make the mount come up the same every boot.
sudo blkid
Here is an example:
terrance@terrance-ubuntu:~$ sudo blkid
/dev/sde1: UUID="9e4539a5-7229-424e-aa91-60ab1417e6f1" TYPE="ext4" PARTUUID="00090c7c-01"
Using the UUID number from the above example, now we are going to add it to the /etc/fstab
file. Use your favorite editor, and add the following line to the /etc/fstab
file. Note: This file is owned by root, so it needs to be edited with elevated permissions.
sudo nano /etc/fstab
Then add to the bottom:
UUID=9e4539a5-7229-424e-aa91-60ab1417e6f1 /media/datadrive ext4 defaults 0 0
You can now activate the mount by typing in the following with no reboot required:
sudo mount -a
Now on every reboot the new drive will mount to the /media/datadrive
mount point every time.
Hope this helps!
Solution 2
/dev/sdb is the entire block device, you don't mount this.
You mount a partion that is on the device, example:
sudo mount /dev/sdb1 /mnt
From the first image, it looks as if there are no partitions on the disk any way, or you have recently made some changes to the partiton table and the kernel is not aware of them, so it is best to run
sudo partprobe
after making changes to inform the kernel to take a look at the new partion table.
No need to reboot, just run partprobe.
You mount the partitions on the disk to a mount point somewhere on the root filesystem (/).
Don't mount the disk directly to / , i.e. don't do the below as you'll be mounting over you root filesystem.
sudo mount /dev/sdb1 / #wrong
Typically, you mount to /mnt or /media or a subdirectory within those for temporary mounting; or by creating a dedicated mount point for that device, /data/ is common.
sudo mkdir /data
sudo mount /dev/sdb1 /data
Also, why does it say 17-May-2015?
That is the release date for that version of e2fsck.
Related videos on Youtube
HelpMeee
Wow, I was very desperate when I chose this display name. That says more about me than anything I could type here. Love music, very interested in computers and programming.
Updated on September 18, 2022Comments
-
HelpMeee over 1 year
Running
sudo fdisk -lu
returns the hdd I want to mount asDisk /dev/sdb
but when I try to mount it from KDE Partition Manager it doesn't show some directories when I try to set up a path (tried showing hidden folders, only displayed 3) and through the konsole with
sudo mount /dev/sdb /mnt
, I getmount: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.
so I tried running
sudo e2fsck -f -b 32768 -y /dev/sdb
and gete2fsck 1.42.13 (17-May-2015) e2fsck: Bad magic number in super-block while trying to open /dev/sdb The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device>
and when I try those variations I get the same message. How do I mount this hard drive? The file type for the hdd is "inode/blockdevice" and I've already created a partition for it but it won't save without a path.
Also, why does it say 17-May-2015?
Many thanks.
EDIT: Was able to find the /dev folder by clicking the bar next to "Look in" however the partitions don't show up even as hidden files but it does show up if I type it into the "Directory:" bar but its not selectable ("Choose" is greyed).
Gparted, as expected, no difference. I'm sure its a file type error..
Re-partition the hard drive in gparted:
and after applying the settings it seems to have worked but upon opening my file manager, the "Devices" listing on the leftside has disappeared! My ssd is not even listed (as it had been before) "Devices" title is not there!
-
Terrance almost 8 yearsUsually you mount by the partition number on the drive. It should be
sudo mount /dev/sdb1 /mnt
meaning to mount the first partition to/mnt
if that is what you're trying to mount. -
HelpMeee almost 8 yearsIts in /dev/ as just "sdb". Oh, I just want it under "Devices" in the file manager (under my SSD)
-
Terrance almost 8 yearsIt needs a partition that's formatted to mount. Those show up as
/dev/sda1
or/dev/sdb1
etc... -
HelpMeee almost 8 yearsDo you know how I would do that through KDE Partition Manager? I've uploaded a picture. Its telling me to create a new partition table; does it need to have at least four? I'm only using it for storage.
-
HelpMeee almost 8 yearsNevermind, its no longer asking me to create a partition table once I clicked "Apply", but the sudo command line to mount still gives the same error.
-
Terrance almost 8 yearsI haven't used the KDE Partition Manager, but I do use
gparted
. To install it,sudo apt install gparted
, then you need to run it with elevated permissions,sudo gparted
. That will allow you to create your new partition to the drive. You only need one partition for storage. What you format it to will depend on how you're going to use it. Cross platform is probably best at NTFS so Windows can read it too. -
HelpMeee almost 8 yearsAre there any downsides to NTFS in comparison to the other available options? (Most likely only sticking with Linux)
-
Terrance almost 8 yearsI used NTFS on all my shared drives as it is compatible with Windows and doesn't suffer from 4GB file size limitation.
-
Terrance almost 8 yearsIf you're only sticking with Linux, ext3 or ext4 are great to use.
-
HelpMeee almost 8 yearsok, added a picture from gparted and not sure how to format the partition to mount.
-
HelpMeee almost 8 yearsI mounted the hard drive! Thanks, guessing KDE Partition manager was at fault. Now I'm having another issue which I will submit as another question. Could you submit an answer instead of a comment so I can mark this question answered? Thank you!
-
Terrance almost 8 yearsYou somehow mounted your new drive as the root, which is not what you need. Reboot your computer, and you need to change the mount of that drive to something other than
/
. You can name it like/data
-
Terrance almost 8 yearsI'll write something up as an answer for you.
-
HelpMeee almost 8 yearsI originally mounted it to
mnt
then changed it to/
because I wanted it beneath the ssd in the device list in the file manager, my mistake. I'm guessing I'll have to change the mount point through the BIOS? -
Terrance almost 8 yearsBut you need to reboot your system now
-
HelpMeee almost 8 yearsalright, I rebooted and its listed under devices now! :D Is there really a problem with it being mounted under root?
-
Terrance almost 8 yearsYour OS is mounted as
/
so we need to mount it to another location. I am writing up an answer right now for you. -
HelpMeee almost 8 yearsI haven't noticed any conflict but alright. I'm trying to start gparted again and it just asks me for my password then.. closes (like it was a tab at the bottom panel but it doesn't stay longer than two seconds). When I run
sudo gparted
it tells me its already running. -
Terrance almost 8 yearsI answered it for you. You may not need to reformat it right now, only just apply it to a new mount point that I put in my answer for you.
-
-
HelpMeee almost 8 yearsputting
gksu gedit /etc/fstab
into the terminal with no return s: Anyway, I added my hdd's uuid in the same format you lined out (using the terminal) and I'm unsure of how to save the changes. Sorry for the inexperience. -
Terrance almost 8 years@HelpMeee You apply the changes by choosing File and Save, or just exit and it will prompt you to save. If you're using
nano
it is Ctrl+O to write the changes, and then Ctrl+X to exit. Then you can do thesudo mount -a
-
HelpMeee almost 8 years
mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.
after doingsudo mount -a
-
Terrance almost 8 years@HelpMeee What did you format your partition to? And secondly, what line did you add?
-
HelpMeee almost 8 yearsOh, I just did
sudo mount /dev/sdb1 /data
and it looks like that solved that (mounted it elsewhere though, so I have to change the fstab file to match) the partition is ext4 as you put, and I added the exact same line to the fstab file except with my UUID -
Terrance almost 8 years@HelpMeee Yeah, just change your fstab to match then.
-
HelpMeee almost 8 yearsEarlier I saved over root, what are the concerns for that? Thanks for your helpful input! The first code you gave was an essential part of fixing my problem!
-
Marijn almost 3 yearsNote that the fstab option should be
defaults
, with ans
. Without thes
it results in the error from the comment above. -
Terrance almost 3 years@Marijn Good catch! Edited