24

I added a new hard drive (/dev/sdb) to Ubuntu Server 16, ran parted /dev/sdb mklabel gpt and sudo parted /dev/sdb mkpart primary ext4 0G 1074GB. All went fine. Then I tried to mount the drive

mkdir /mnt/storage2
mount /dev/sdb1 /mnt/storage2

It resulted in

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.

I tried mount -t ext4 /dev/sdb1 /mnt/storage2 with identical outcome. I've done this stuff many times before and have never ran into anything like this. I've already read this mount: wrong fs type, bad option, bad superblock on /dev/sdb on CentOS 6.0 to no avail.

fdisk output regarding the drive

Disk /dev/sdb: 1000 GiB, 1073741824000 bytes, 2097152000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0E136427-03AF-48E2-B56B-A467E991629F

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 2097149951 2097147904 1000G Linux filesystem 
41

You still need to create a file system

mkfs.ext4 /dev/sdb1

Parted User's manual https://www.gnu.org/software/parted/manual/html_node/mkpart.html:

2.4.5 mkpart

Command: mkpart [part-type fs-type name] start end

Creates a new partition, without creating a new file system on that partition.

  • 6
    This will wipe out your current drive !! – SudarP Jan 26 at 2:03
  • In doing this, I get a permission denied error. Have you encountered this before? – Kosta Apr 22 at 5:36
  • @Kosta you must run the command as a superuser (i.e. sudo) – Eli Korvigo May 13 at 12:54
5

I had this problem with /dev/sda on Ubuntu 16.04 I solved it by booting into a live usb and doing the following:

To see your disks use lsblk

If you can see your drive thats good, run fdisk -l to see if the system can use it.

Run this command to attempt to repair bad superblocks on the drive.

fsck /dev/sda1 (replace /dev/sda1 with the drive you want to fix).

When it asks to repair blocks select yes by pressing 'y'

Allow fsck to repair all bad blocks.

Then I was able to mount the device using

sudo mount /dev/sda /media/ubuntu

This solved it for me.

  • Trying this, I get a permission denied error for both fdisk -l and the fsck command. Is there a workaround? – Kosta Apr 22 at 5:37
0
# create mount dir
sudo mkdir /hdd6T

# new file system
sudo mkfs.ext4 /dev/sdc

# mount drive
sudo mount /dev/sdc /hdd6T/

# change ownership to specified user
sudo chown your-user /hdd6T/
  • The question already says mkdir and mount, and the accepted answer says mkfs.ext4.  You’ve added chown, which has nothing to do with the question, so you aren’t really contributing any useful new information. – G-Man Apr 7 at 4:18
-1
sudo mount -o ro,noload -t ext4 /dev/sdc /mnt 

should work

  • ReddyP, I'd point out that /dev/sdc isn't part of the question; did you mean /dev/sdb, perhaps? – Jeff Schaller May 2 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.