External HDD Issues

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
TurtleP
Posts: 16
Joined: Sat Feb 08, 2020 5:52 pm

Re: External HDD Issues

Post by TurtleP »

Yeah, checking what was using it was root via mount.

I disabled device power off, which helped because a manual mount didn't timeout. However, transferring files can still cause random I/O errors.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: External HDD Issues

Post by MichaIng »

Probably the issue is the automated drive spin down via hdparm. We have this by default enabled on /dev/sda which does not make much sense in case of SSD and flash drive and is not wanted with root on external drive. The plan is to make this an optional feature per-drive and enable for spinning non-root devices only. Could you try:

Code: Select all

rm /etc/hdparm.conf
reboot
And see if the issue persists?
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: External HDD Issues

Post by baz123 »

I've given up on HDD/SSD with DietPi currently. As I posted elsewhere, moving the rootfs to an HDD/SSD (I tried both) caused it to continually disconnect and crash. I also tried it on a Pi3 (where it used to work) as well as the Pi4 I first saw the issues on. I've now installed Rasbian Lite and moved the rootfs and it is fine, so it is definitely a DietPi issue. It used to work OK and I like DietPi, but it simply does not work at the moment.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: External HDD Issues

Post by MichaIng »

Okay, I just reviewed the code and made some failsafe changes, but there was nothing that would break it on our current RPi image, from what I see.

Just to be sure, the external drive has a dedicated power supply? Does Raspbian have max USB power enabled in config.txt after moving root fs?
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: External HDD Issues

Post by baz123 »

So I tried it

* with the Pi4 and an SSD and a genuine Pi4 Power supply
* with the Pi4 and a WD PiDrive powered by the pi4 PS and the Drive by the PiDrive PS
* with the Pi3 and an SSD and a genuine Pi Power supply
* with the Pi3 and a WD PiDrive powered by the PiDrive PS with the split cable (this is the config that last worked with a stretch image).

All configurations stopped responding clearly having lost contact with the rootfs on the external drive.

As I say, a Raspbian Lite image, manually moving the rootfs works flawlessly on the Pi4 with SSD (where I started). No need for quirks or any fiddling with USB power settings.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: External HDD Issues

Post by MichaIng »

Can you paste from Raspbian (after successully moving rootfs): cat /boot/{cmdline,config}.txt
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: External HDD Issues

Post by baz123 »

MichaIng wrote: Fri Feb 21, 2020 6:46 pm Can you paste from Raspbian (after successully moving rootfs): cat /boot/{cmdline,config}.txt

Code: Select all

pi@raspberrypi:~ $ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 223.6G  0 disk
└─sda1        8:1    0 223.6G  0 part /
mmcblk0     179:0    0  14.9G  0 disk
├─mmcblk0p1 179:1    0   256M  0 part /boot
└─mmcblk0p2 179:2    0  14.6G  0 part
pi@raspberrypi:~ $ cat /boot/{cmdline,config}.txt
console=serial0,115200 console=tty1 root=PARTUUID=20cb7aed-01 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: External HDD Issues

Post by MichaIng »

So it works fine in your case without rootdelay=10 which we add to cmdline.txt when moving root to external drive. However besides the delay this should not break boot.
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: External HDD Issues

Post by baz123 »

MichaIng wrote: Sat Feb 22, 2020 8:53 pm So it works fine in your case without rootdelay=10 which we add to cmdline.txt when moving root to external drive. However besides the delay this should not break boot.
Yes what I have works fine on Raspbian and doesn't on DietPi in any of the configurations I tried.

It doesn't break boot - the disk boots fine. Just after running for a while (20 mins or so) the root folder on the SSD *appears* to become disconnected. If there is an SSH session connected, no commands work, just get an IO error or command not found and the only solution is to remove the power supply.

Nothing in logs.

I wondered about kernel version?
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: External HDD Issues

Post by MichaIng »

The kernel it the same on Raspbian and DietPi. Probably automated spindown is an issue. Did you try:

Code: Select all

rm /etc/hdparm.conf
reboot
Post Reply