3

Running sudo fdisk -lu returns the hdd I want to mount as

Disk /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 get

mount: 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 get

e2fsck 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.

enter image description here

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).

enter image description here

Gparted, as expected, no difference. I'm sure its a file type error..

enter image description here

Re-partition the hard drive in gparted:

enter image description here

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!

HelpMeee
  • 648

2 Answers2

5

/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.

2

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!

Terrance
  • 43,712