2

This is my first question, so I apologize in advance if I don't follow the correct format. I have looked around extensively on the internet without finding success with any of their answers. Thank you in advance for your efforts in helping. So, on to the problem...

SETUP
I have set up an Ubuntu 17.10 Desktop on my Intel NUC (NUC6i7KYK) with the intent to use it as my personal home server. I have installed Seafile-server-6.2.2 on it, but have pointed the seafile-data files as a symbolic link to a location on my Western Digital 3TB external USB 3.0 HDD because of space. First I tried simply linking to the auto-mounted version in /media/Jason\ Stuff, however it complained about permissions. Because of this, I mounted it using /etc/fstab with the following line:

UUID=C6B89CABB89C9B8D /mnt/seafile ntfs-3g permissions,locale=en_US.utf8 0

This has had issues mounting on startup (separate issue, I know), but it has made seafile happy to interact with it because it now has permissions.

PROBLEM
After a random amount of time, the drive would report an "input/output" error. While annoying, I can easily fix it with running sudo mount -a.

jason@jason-server:~$ ls /mnt/seafile/
ls: reading directory '/mnt/seafile/': Input/output error
jason@jason-server:~$ sudo mount -a
Using default user mapping
jason@jason-server:~$ ls /mnt/seafile/
22cf6ba959c9fab923049c    M8H.CAP
backup                    msdownld.tmp
cyberlink                 $RECYCLE.BIN
db89ef3f6183c6567ed6def3  System Volume Information
eclipseAndroid-20140702   WD Stuff

I originally thought there might be some problem with the spinning of the external HDD, but using sudo sdparm --clear=STANDBY /dev/sda -S didn't solve the issue. I noticed several times, however, that my external HDD would disappear from Linux entirely. I seached using several commands to no avail, and it didn't even appear in /dev anymore. These are the exact results I have found (first is when the drive is there, vs the second one afterwards when it disappears):

blkid before:

jason@jason-server:~$ sudo blkid
/dev/nvme0n1p3: LABEL="System Reserved" UUID="AC3C58B63C587D70" TYPE="ntfs" PARTUUID="1a3a42c8-03"
/dev/nvme0n1p4: UUID="509E26619E264038" TYPE="ntfs" PARTUUID="1a3a42c8-04"
/dev/nvme0n1p5: UUID="b5081df8-5a84-4faf-8da4-bbcefe2b2d4c" TYPE="ext4" PARTUUID="1a3a42c8-05"
/dev/nvme0n1: PTUUID="1a3a42c8" PTTYPE="dos"
/dev/sdd1: LABEL="Jason Stuff" UUID="C6B89CABB89C9B8D" TYPE="ntfs"

blkid after:

jason@jason-server:~$ sudo blkid
/dev/nvme0n1p3: LABEL="System Reserved" UUID="AC3C58B63C587D70" TYPE="ntfs" PARTUUID="1a3a42c8-03"
/dev/nvme0n1p4: UUID="509E26619E264038" TYPE="ntfs" PARTUUID="1a3a42c8-04"
/dev/nvme0n1p5: UUID="b5081df8-5a84-4faf-8da4-bbcefe2b2d4c" TYPE="ext4" PARTUUID="1a3a42c8-05"
/dev/nvme0n1: PTUUID="1a3a42c8" PTTYPE="dos"

fdisk before:

jason@jason-server:~$ sudo fdisk -l
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 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: 0x1a3a42c8

Device         Boot     Start       End   Sectors  Size Id Type
/dev/nvme0n1p1           2046 195311615 195309570 93.1G  5 Extend
/dev/nvme0n1p3 *    195311616 196028415    716800  350M  7 HPFS/N
/dev/nvme0n1p4      196028416 500115455 304087040  145G  7 HPFS/N
/dev/nvme0n1p5           2048 195311615 195309568 93.1G 83 Linux

Partition table entries are not in disk order.


Disk /dev/sdd: 2.7 TiB, 3000558944256 bytes, 732558336 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000246c6

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdd1         256 732558335 732558080  2.7T  7 HPFS/NTFS/exFA

fdisk after:

jason@jason-server:~$ sudo fdisk -l
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 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: 0x1a3a42c8

Device         Boot     Start       End   Sectors  Size Id Type
/dev/nvme0n1p1           2046 195311615 195309570 93.1G  5 Extend
/dev/nvme0n1p3 *    195311616 196028415    716800  350M  7 HPFS/N
/dev/nvme0n1p4      196028416 500115455 304087040  145G  7 HPFS/N
/dev/nvme0n1p5           2048 195311615 195309568 93.1G 83 Linux

Partition table entries are not in disk order.

lsusb before:

jason@jason-server:~$ lsusb
Bus 002 Device 010: ID 1058:1140 Western Digital Technologies, Inc. My Book Essential (WDBACW)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp. 
Bus 001 Device 005: ID 1038:0100 SteelSeries ApS Ideazon Zboard
Bus 001 Device 004: ID 06a3:0ccd Saitek PLC 
Bus 001 Device 002: ID 03eb:3301 Atmel Corp. at43301 4-Port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb after:

jason@jason-server:~$ lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp. 
Bus 001 Device 005: ID 1038:0100 SteelSeries ApS Ideazon Zboard
Bus 001 Device 004: ID 06a3:0ccd Saitek PLC 
Bus 001 Device 002: ID 03eb:3301 Atmel Corp. at43301 4-Port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/dev before:

jason@jason-server:~$ ls /dev | grep sd
sdd
sdd1

/dev after:

jason@jason-server:~$ ls /dev | grep sd

I have also checked /var/log/syslog and the only thing I have found suspicious was this log (which also appears multiple times in dmesg):

Oct 30 13:58:05 jason-server kernel: [261107.413132] usb 2-4: reset SuperSpeed USB device number 13 using xhci_hcd

The only way I have found to fix the external HDD when it gets into this state is to physically unplug/power-off, turn it back on, and run the sudo mount -a command again.
I have also noticed that every time I have to manually reset the external HDD, it is assigned a different device path. It started at /dev/sda1 and it is now at /dev/sdf1

/dev/sdf1: LABEL="Jason Stuff" UUID="C6B89CABB89C9B8D" TYPE="ntfs"

QUESTIONS Why is the drive becoming unavailable with an IO error? Why is it randomly disappearing entirely from the OS? Is sudo sdparm --clear=STANDBY /dev/sda -S not the right command to keep an external HDD spinning? Is the drive device path changing to be expected?

I'm quite out of ideas at this point, and any help would be wonderful.

2 Answers 2

1
  • boot-up mount issue might be that after paramters you need 2 numbers, so I suggest to change your /etc/fstab line to
    UUID=C6B89CABB89C9B8D /mnt/seafile ntfs-3g permissions,locale=en_US.utf8 0 1
  • Your external drive is not SCSI, so I suggest to use hdparm. Flag -S 0 would do the trick.
  • What if you plug that external drive to another computer (and wait for longer time)? Is it also dissapears? At 1st sight it seems powersave issue.
  • /dev/sdxx can change. Especially if system believes that previous disk could reappear...
    This is why (in scripts) it is wise to use /dev/disk/by-* path rather than /dev/sd*
1
  • Thanks for the reply! When I use hdparm I get this error back: jason@jason-server:~$ sudo hdparm -S 0 /dev/sdg /dev/sdg: setting standby to 0 (off) SG_IO: bad/missing sense data, sb[]: 70 00 01 00 00 00 00 0a 00 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - I have plugged it into various windows computers without a single issue for weeks on end. I don't have any other Linux boxes to check it out with, unfortunately... - Oh good, that is why I am using the UUID instead. I just wanted to make sure that it wasn't something bad. Oct 31, 2017 at 7:25
0

I recommend trying to reset the USB controller. Here are a couple guides depending on the OS you are using.

http://www.zedt.eu/tech/linux/restar...system-centos/

There are a number of scripts around using similar methods.

http://billauer.co.il/blog/2013/02/u...ci-uhci-linux/ http://marc.info/?l=linux-usb&m=121459435621262&w=2 http://www.clearchain.com/blog/posts...us-under-linux

From https://www.linuxquestions.org/questions/linux-general-1/rescan-for-usb-devices-754916/ https://www.linuxquestions.org/questions/red-hat-31/usb-mount-not-listed-in-fdisk-4175550470/page2.html

https://unix.stackexchange.com/questions/7412/how-to-reconnect-a-logically-disconnected-usb-device

1
  • Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – MMM
    May 25, 2021 at 8:14

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.