Partition and mount external USB HDD

Problem Description

I am an inexperienced linux user. I tried to partition a brand-new external USB HDD via ssh, and could not.

dmesg log (more complete log below):

[20260.159142] sd 1:0:0:0: Device offlined - not ready after error recovery
[20260.159306] sd 1:0:0:0: rejecting I/O to offline device
[20260.165379] sd 1:0:0:0: [sda] Read Capacity(16) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

I wonder if the A20-OLinuXino-LIME2 board can’t supply enough power to power the router and spin the HDD?

I believe this is a different problem than USB flash drive not appear, Mount encrypted ext4 disk, and Adding external USB HDD to a Freedombox.

Steps to Reproduce

  1. I’m talking to my brand-new Pioneer Edition Freedombox through a brand-new GL-MT300N-V2 wireless router. The LIME2 board is powered via the PWR jack with 5V DC, and supplies power to the router via one of its two USB hosts.
  2. I connected a brand-new Seagate Backup Plus Slim Portable 1 TB HDD to the LIME2 board’s other USB host, with intention to partition it, install a filesystem, and use it as network storage. The LIME2 is the HDD’s only source of power. The HDD’s light comes on.

Expected Results

  1. I expected to see the HDD in plinth > system > storage.
  2. I expected to discover the hdd with udevadm info --query=all --name=/dev/sda
  3. I expected to discover the hdd with fdisk -l
  4. I expected to discover the hdd with lsblk -a
  5. I expected to be able to begin to partition the hdd with parted --align=opt /dev/sda

Actual results

  1. Failure. plinth > system > storage displays /dev/mmcblk0p1 and /dev/mmcblk0p2, but not the HDD.

  2. Success. udevadm info --query=all --name=/dev/sda:

    /dev/disk/by-path/platform-1c1c000.usb-usb-0:1:1.0-scsi-0:0:0:0 /dev/disk/by-id/usb-Seagate_BUP_Slim_00000000NAB56DCJ-0:0

  3. Failure. fdisk -l:

    Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 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: dos
    Disk identifier: 0x1af3e6b0

    Device Boot Start End Sectors Size Id Type
    /dev/mmcblk0p1 * 2048 264192 262145 128M 83 Linux
    /dev/mmcblk0p2 266240 62333951 62067712 29.6G 83 Linux

  4. Success? lsblk -a:

    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 1 disk
    mmcblk0 179:0 0 29.7G 0 disk
    |-mmcblk0p1 179:1 0 128M 0 part /boot
    `-mmcblk0p2 179:2 0 29.6G 0 part /

  5. Failure. sudo parted --align=opt /dev/sda:

    error: Error opening /dev/sda: No such device or address.

output of dmesg after attaching HDD

[20007.293237] usb 2-1: new high-speed USB device number 4 using ehci-platform
[20007.498831] usb 2-1: New USB device found, idVendor=0bc2, idProduct=ac30, bcdDevice=17.07
[20007.498849] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[20007.498856] usb 2-1: Product: BUP Slim
[20007.498863] usb 2-1: Manufacturer: Seagate
[20007.498870] usb 2-1: SerialNumber: 00000000NAB56DCJ
[20007.511731] scsi host1: uas
[20007.516599] scsi 1:0:0:0: Direct-Access     Seagate  BUP Slim         1707 PQ: 0 ANSI: 6
[20007.522496] sd 1:0:0:0: Attached scsi generic sg0 type 0
[20007.522496] sd 1:0:0:0: Attached scsi generic sg0 type 0
[20055.658092] sd 1:0:0:0: [sda] Spinning up disk...
[20076.720266] ...not responding...
[20249.337920] sd 1:0:0:0: tag#28 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD
[20249.337952] sd 1:0:0:0: tag#28 CDB: Read capacity(16) 9e 10 00 00 00 00 00 00 00 00 00 00 00 20 00 00
[20249.353924] scsi host1: uas_eh_device_reset_handler start
[20249.481992] usb 2-1: reset high-speed USB device number 4 using ehci-platform
[20249.691236] scsi host1: uas_eh_device_reset_handler success
[20259.821775] sd 1:0:0:0: tag#28 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD
[20259.821805] sd 1:0:0:0: tag#28 CDB: Test Unit Ready 00 00 00 00 00 00
[20259.821819] scsi host1: uas_eh_device_reset_handler start
[20259.949856] usb 2-1: reset high-speed USB device number 4 using ehci-platform
[20260.159108] scsi host1: uas_eh_device_reset_handler success
[20260.159142] sd 1:0:0:0: Device offlined - not ready after error recovery
[20260.159306] sd 1:0:0:0: rejecting I/O to offline device
[20260.165379] sd 1:0:0:0: [sda] Read Capacity(16) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[20260.165394] sd 1:0:0:0: [sda] Sense not available.
[20260.165454] sd 1:0:0:0: rejecting I/O to offline device
[20260.181958] sd 1:0:0:0: rejecting I/O to offline device
[20260.187346] sd 1:0:0:0: rejecting I/O to offline device
[20260.199914] sd 1:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[20260.199934] sd 1:0:0:0: [sda] Sense not available.
[20260.200011] sd 1:0:0:0: rejecting I/O to offline device
[20260.212772] sd 1:0:0:0: rejecting I/O to offline device
[20260.218178] sd 1:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
[20260.218189] sd 1:0:0:0: [sda] 0-byte physical blocks
[20260.218244] sd 1:0:0:0: rejecting I/O to offline device
[20260.231245] sd 1:0:0:0: [sda] Write Protect is on
[20260.231266] sd 1:0:0:0: [sda] Mode Sense: 54 19 b7 c9
[20260.231345] sd 1:0:0:0: rejecting I/O to offline device
[20260.236912] sd 1:0:0:0: rejecting I/O to offline device
[20260.242694] sd 1:0:0:0: [sda] No Caching mode page found
[20260.248117] sd 1:0:0:0: [sda] Assuming drive cache: write through
[20260.254335] sd 1:0:0:0: rejecting I/O to offline device
[20260.259661] sd 1:0:0:0: rejecting I/O to offline device
[20260.265052] sd 1:0:0:0: rejecting I/O to offline device
[20260.275134] sd 1:0:0:0: [sda] Attached SCSI disk

Information

  • FreedomBox version: 20.2
  • Hardware: Olimex A20-OLinuXino-LIME2
  • How did you install FreedomBox?: Bought pre-installed hardware (pioneer edition)
  • uname -a: Linux freedombox 4.19.0-8-armmp-lpae #1 SMP Debian 4.19.98-1 (2020-01-26) armv7l GNU/Linux
1 Like

Thank you for a detailed report. Typically in dmesg output we expect to see the reading of the partition table and printing of available partitions. It appears this didn’t happen and even the initial few blocks needed for this were not read from the drive. If the drive is working with another machine, we can doubt that the amount of power being supplied to it by Lime2 being insufficient. To rectify:

  • Try attaching it a powered USB hub or,
  • Try providing the Lime2 with more power.
    • By using a power supply with higher amperage.
    • Or by providing secondary power supply to Lime2 via the mini-USB port. In this case, the Lime2’s power IC will intelligently draw power from both main barrel connector and mini-USB as needed.