2

Final Edit A quick note to say thanks for the comments, I certainly learned a lot. Unfortunately, having decided to return the HDD they tested it themselves and concluded that the device was faulty.

I recently bought an internal 4TB HDD to add to a Ubuntu machine. This is my first attempt at adding an HDD to an established machine and mounting it to a specific location. Unfortunately, I'm running into some problems and all similar posts I've seen haven't quite resolved my issue. Therefore, I will try and give a complete breakdown of the steps I understood, followed and the errors I'm facing.

My version of Ubuntu:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal

Firstly, after many failed efforts at adding a partition to the HDD and mounting the HDD I've killed the table so consider this as my baseline:

sudo dd if=/dev/zero of=/dev/sdc bs=1M count=10

The disk is /dev/sdc

When I use lsblk this is the output (sdc is at the bottom):

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0  55.5M  1 loop /snap/core18/2074
loop1    7:1    0     4K  1 loop /snap/bare/5
loop2    7:2    0  55.4M  1 loop /snap/core18/2128
loop3    7:3    0   219M  1 loop /snap/gnome-3-34-1804/66
loop4    7:4    0   219M  1 loop /snap/gnome-3-34-1804/72
loop5    7:5    0  65.1M  1 loop /snap/gtk-common-themes/1515
loop6    7:6    0  65.2M  1 loop /snap/gtk-common-themes/1519
loop7    7:7    0    51M  1 loop /snap/snap-store/542
loop8    7:8    0    51M  1 loop /snap/snap-store/547
loop9    7:9    0  32.3M  1 loop /snap/snapd/13170
loop10   7:10   0  32.4M  1 loop /snap/snapd/13270
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0 465.3G  0 part /
sdb      8:16   0 931.5G  0 disk 
├─sdb1   8:17   0   116M  0 part 
├─sdb2   8:18   0   506M  0 part 
└─sdb3   8:19   0 930.9G  0 part 
sdc      8:32   0   3.7T  0 disk 
sr0     11:0    1  1024M  0 from 

And with sudo fdisk -l

Disk /dev/sdc: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: TOSHIBA MG03ACA4
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

I then use gdisk (I have tried using parted) to assign a partition table with type and name etc.

Adding a new partition:

Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-7814037134, default = 2048) or {+-}size{KMGTP}: 2048
Last sector (2048-7814037134, default = 7814037134) or {+-}size{KMGTP}: 7814037134
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): 
Changed type of partition to 'Linux filesystem'

Let's look at it with p (print)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      7814037134   3.6 TiB     8300  Linux filesystem

I want to call it store:

Command (? for help): c store
Using 1
Enter name: store

(after a print)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      7814037134   3.6 TiB     8300  store

Finally write the partition table to disk and exit (with w):

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sdc.
The operation has completed successfully.

Let's look at the drives and mount points again (lsblk):

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0  55.5M  1 loop /snap/core18/2074
loop1    7:1    0     4K  1 loop /snap/bare/5
loop2    7:2    0  55.4M  1 loop /snap/core18/2128
loop3    7:3    0   219M  1 loop /snap/gnome-3-34-1804/66
loop4    7:4    0   219M  1 loop /snap/gnome-3-34-1804/72
loop5    7:5    0  65.1M  1 loop /snap/gtk-common-themes/1515
loop6    7:6    0  65.2M  1 loop /snap/gtk-common-themes/1519
loop7    7:7    0    51M  1 loop /snap/snap-store/542
loop8    7:8    0    51M  1 loop /snap/snap-store/547
loop9    7:9    0  32.3M  1 loop /snap/snapd/13170
loop10   7:10   0  32.4M  1 loop /snap/snapd/13270
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0 465.3G  0 part /
sdb      8:16   0 931.5G  0 disk 
├─sdb1   8:17   0   116M  0 part 
├─sdb2   8:18   0   506M  0 part 
└─sdb3   8:19   0 930.9G  0 part 
sdc      8:32   0   3.7T  0 disk 
└─sdc1   8:33   0   3.7T  0 part 
sr0     11:0    1  1024M  0 rom  

I now want to mount my drive to a location called /store (yes, the same name as the partition on sdc1 - I hope that isn't confusing). This is where I run into an error:

(base) anthony@Shodan:/dev$ sudo mount -o rw /dev/sdc1 /store
mount: /store: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.

I am really not sure what to do from here. I've repeated the same process above but using parted. The steps are successful but again it fails when I try mounting.

EDIT #1 Thanks for the comments. Turns out I didn't create a filesystem so I executed the following but had an error:

(base) anthony@Shodan:~$ sudo mkfs.ext4 /dev/sdc1
[sudo] password for anthony: 
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 976754385 4k blocks and 244195328 inodes
Filesystem UUID: d6b2219f-b4fe-490b-bf21-513fec50c625
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: mkfs.ext4: Input/output error while writing out and closing file system

I then install smartmodtools and used smartctl to test the new drive but I ran into a further problem:

(base) anthony@Shodan:~$ sudo smartctl --smart=on -T permissive /dev/sdc
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.11.0-37-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

Short INQUIRY response, skip product id
=== START OF ENABLE/DISABLE COMMANDS SECTION ===
unable to fetch IEC (SMART) mode page [scsi response fails sanity test]
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

EDIT #2 I'm still struggling to get this drive to work. The disk support SMART (just checked BIOS), and this is what the kernel sees:

(base) anthony@Shodan:/$ dmesg | egrep -i "sdc"
[    1.696642] sd 2:0:0:0: [sdc] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[    1.696658] sd 2:0:0:0: [sdc] Write Protect is off
[    1.696661] sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[    1.696680] sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.930394]  sdc: sdc1
[    1.943940] sd 2:0:0:0: [sdc] Attached SCSI disk
[ 2857.111158] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=90s
[ 2857.111168] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 35 c0 08 00 00 00 00 08 00 00
[ 2857.111172] blk_update_request: I/O error, dev sdc, sector 901777408 op 0x1:(WRITE) flags 0x100000 phys_seg 8 prio class 0
[ 2857.111184] Buffer I/O error on dev sdc1, logical block 901775360, lost async page write
[ 2857.111191] Buffer I/O error on dev sdc1, logical block 901775361, lost async page write
[ 2857.111199] Buffer I/O error on dev sdc1, logical block 901775362, lost async page write
[ 2857.111204] Buffer I/O error on dev sdc1, logical block 901775363, lost async page write
[ 2857.111208] Buffer I/O error on dev sdc1, logical block 901775364, lost async page write
[ 2857.111212] Buffer I/O error on dev sdc1, logical block 901775365, lost async page write
[ 2857.111215] Buffer I/O error on dev sdc1, logical block 901775366, lost async page write
[ 2857.111223] Buffer I/O error on dev sdc1, logical block 901775367, lost async page write
[ 2857.111365] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111370] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 36 00 08 00 00 00 00 08 00 00
[ 2857.111371] blk_update_request: I/O error, dev sdc, sector 905971712 op 0x1:(WRITE) flags 0x100000 phys_seg 8 prio class 0
[ 2857.111375] Buffer I/O error on dev sdc1, logical block 905969664, lost async page write
[ 2857.111378] Buffer I/O error on dev sdc1, logical block 905969665, lost async page write
[ 2857.111407] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111410] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 36 40 08 00 00 00 00 08 00 00
[ 2857.111410] blk_update_request: I/O error, dev sdc, sector 910166016 op 0x1:(WRITE) flags 0x100000 phys_seg 8 prio class 0
[ 2857.111430] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111432] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 36 80 08 00 00 00 00 08 00 00
[ 2857.111433] blk_update_request: I/O error, dev sdc, sector 914360320 op 0x1:(WRITE) flags 0x100000 phys_seg 8 prio class 0
[ 2857.111451] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111453] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 36 c0 08 00 00 00 00 08 00 00
[ 2857.111454] blk_update_request: I/O error, dev sdc, sector 918554624 op 0x1:(WRITE) flags 0x100000 phys_seg 8 prio class 0
[ 2857.111471] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111473] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 37 00 08 00 00 00 00 08 00 00
[ 2857.111474] blk_update_request: I/O error, dev sdc, sector 922748928 op 0x1:(WRITE) flags 0x100000 phys_seg 8 prio class 0
[ 2857.111484] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111486] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 37 40 08 00 00 00 00 08 00 00
[ 2857.111487] blk_update_request: I/O error, dev sdc, sector 926943232 op 0x1:(WRITE) flags 0x800 phys_seg 8 prio class 0
[ 2857.111517] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111520] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 37 80 08 00 00 00 00 08 00 00
[ 2857.111521] blk_update_request: I/O error, dev sdc, sector 931137536 op 0x1:(WRITE) flags 0x800 phys_seg 8 prio class 0
[ 2857.111539] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111541] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 37 c0 08 00 00 00 00 08 00 00
[ 2857.111542] blk_update_request: I/O error, dev sdc, sector 935331840 op 0x1:(WRITE) flags 0x800 phys_seg 8 prio class 0
[ 2857.111567] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 2857.111569] sd 2:0:0:0: [sdc] tag#0 CDB: Write(16) 8a 00 00 00 00 00 38 00 08 00 00 00 00 08 00 00
[ 2857.111570] blk_update_request: I/O error, dev sdc, sector 939526144 op 0x1:(WRITE) flags 0x800 phys_seg 8 prio class 0
[ 3053.218272] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 3053.218285] sd 2:0:0:0: [sdc] tag#0 CDB: ATA command pass through(16) 85 06 20 00 00 00 00 00 00 00 00 00 00 00 e5 00
[ 3638.943105] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 3638.943112] sd 2:0:0:0: [sdc] tag#0 CDB: ATA command pass through(16) 85 06 2c 00 00 00 00 00 00 00 00 00 00 00 e5 00
[ 3653.216166] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 3653.216179] sd 2:0:0:0: [sdc] tag#0 CDB: ATA command pass through(16) 85 06 20 00 00 00 00 00 00 00 00 00 00 00 e5 00
[ 3971.568186] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 3971.568192] sd 2:0:0:0: [sdc] tag#0 CDB: Synchronize Cache(10) 35 00 00 00 00 00 00 00 00 00
[ 3971.568197] blk_update_request: I/O error, dev sdc, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 0 prio class 0
[ 3971.568235] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 3971.568237] sd 2:0:0:0: [sdc] tag#0 CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00
[ 3971.568238] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
[ 3971.568256] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 3971.568258] sd 2:0:0:0: [sdc] tag#0 CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00
[ 3971.568259] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 3971.568262] Buffer I/O error on dev sdc, logical block 0, async page read
[ 3971.568276] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 3971.568278] sd 2:0:0:0: [sdc] tag#0 CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00
[ 3971.568279] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 3971.568281] Buffer I/O error on dev sdc, logical block 0, async page read
[ 3971.569093] sd 2:0:0:0: [sdc] Read Capacity(16) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ 3971.569103] sd 2:0:0:0: [sdc] Sense not available.
[ 3971.569160] sd 2:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ 3971.569164] sd 2:0:0:0: [sdc] Sense not available.
[ 3971.569203] sd 2:0:0:0: [sdc] 0 512-byte logical blocks: (0 B/0 B)
[ 3971.569280] sdc: detected capacity change from 7814037168 to 0
[ 4048.513170] sd 2:0:0:0: [sdc] Read Capacity(16) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ 4048.513175] sd 2:0:0:0: [sdc] Sense not available.
[ 4048.513197] sd 2:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ 4048.513198] sd 2:0:0:0: [sdc] Sense not available.
[ 4053.558167] sd 2:0:0:0: [sdc] Read Capacity(16) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ 4053.558170] sd 2:0:0:0: [sdc] Sense not available.
[ 4053.558188] sd 2:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ 4053.558189] sd 2:0:0:0: [sdc] Sense not available.
[ 4253.213080] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 4253.213094] sd 2:0:0:0: [sdc] tag#0 CDB: ATA command pass through(16) 85 06 20 00 00 00 00 00 00 00 00 00 00 00 e5 00
[ 4853.209760] sd 2:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK cmd_age=0s
[ 4853.209774] sd 2:0:0:0: [sdc] tag#0 CDB: ATA command pass through(16) 85 06 20 00 00 00 00 00 00 00 00 00 00 00 e5 00
3
  • There also now are two labels with gpt partitioned drives. One is GUID(gpt) partition label & other is the formatted partition label. You can see both with lsblk -e7 -o FSTYPE,NAME,LABEL,PARTLABEL,SIZE,MOUNTPOINT And to add to use of labels, parted uses mklabel as command to set drive to gpt (or msdos).
    – oldfred
    Oct 19, 2021 at 13:42
  • @oldfred Thanks for your comment. I'm fairly new at disk management and I'm afraid I don't quite understand. From the output I included, where are the two labels with gpt partitioned drives? Thanks. Oct 19, 2021 at 14:12
  • Added further information in the first edit. Oct 19, 2021 at 14:52

1 Answer 1

1

You didn't create a filesystem on the partition, you need one to be able to mount it. You probably want Ext4 (default for most distributions, if you are dualbooting with Windows, NTFS would a be better choice) so simply run mkfs.ext4 /dev/sdc1 and after that you can mount sdc1.

6
  • Thank you! On executing mkdf.ext4 I get the following: Writing superblocks and filesystem accounting information: mkfs.ext4: Input/output error while writing out and closing file system Oct 19, 2021 at 12:51
  • The I/O errors usually mean hardware failure, if it's a new HDD it could be a cable or loose connection issue. Try SMART test and check logs for more errors. Oct 19, 2021 at 13:59
  • All new territory. I tried SMART and it kicks out the following error when I just print disk info: Read defect list: asked for grown list but didn't get it Error Counter logging not supported Device does not support Self Test logging Oct 19, 2021 at 14:41
  • Added further information in the first edit. Oct 19, 2021 at 14:52
  • Internal or external drive? USB3 adapters do not always support all features like an internal drive. Some do not even fully support gpt or large drives. I create mount point & mount using that for permanent mounts. But label everything else, so auto mount uses label. But also am converting to use labels for some other mounts. I now try to avoid using UUID except for system mounts that are created automatically. But I have labeled partition as Data, but created mount data. Those are different as Linux is case sensitive.
    – oldfred
    Oct 19, 2021 at 15:39

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.