parkspark
Posts: 4
Joined: Fri Jun 11, 2021 9:00 am

Disconnect when connecting USB while using an external disk

Fri Jun 11, 2021 10:52 am

external SSD disk is sda1 /media/pi/ssd_disk
lsblk.png
lsblk.png (9.45 KiB) Viewed 503 times
While using an external SSD disk in Raspberry
When Connect USB memory unmounted and the name of the external SSD disk is changed.
eject.png
eject.png (4.53 KiB) Viewed 503 times
external SSD disk is sdc1 unmount
external Usb Disk is sdb unmount
lsblk2.png
lsblk2.png (11.44 KiB) Viewed 504 times
how do i fix it??

======================================================
Solved

lack of Power Using Card Reader
Normal operation of using USB memory Stick
Last edited by parkspark on Tue Jun 15, 2021 4:46 am, edited 1 time in total.

bjtheone
Posts: 1400
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Disconnect when connecting USB while using an external disk

Fri Jun 11, 2021 12:37 pm

First off we need some background information: what Pi, what OS, and any configuration changes you have made. Next up some details about the actual storage devices would be helpful.

Then we need information on how are you mounting these? With a default config and the current RPiOS, USB based storage will automount. The expectation is that you unmount (eject) it before removal. Odd things will occur if you just unplug mounted file systems.

If multiple USB based storage devices are present at boot, the names are not consistent, they are mounted in the order they are seen. The system will treat USB memory devices and USB connected SSDs the same. You can change this behaviour by manually mounting via the fstab, however this will only work for always connected devices.

Lastly, what are you trying to do and what behaviour would you like?

pidd
Posts: 2309
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Disconnect when connecting USB while using an external disk

Fri Jun 11, 2021 1:58 pm

You are temporarily running out of power when you connect the extra device as the new device charges its capacitors.

You could used a powered hub to alleviate the problem.

Occasionally using an un-powered hub for "live" connections helps as it can limit the inrush current or provide extra reserve power.

Doug_
Posts: 72
Joined: Tue Oct 08, 2019 6:40 pm

Re: Disconnect when connecting USB while using an external disk

Fri Jun 11, 2021 2:36 pm

You are temporarily running out of power when you connect the extra device
I doubt this is the case.

I have had this problem myself with RPOS and PI4 4G, SSD powered from PI4 and all other peripherals powered from and external hub with substantial external power. SSD (with boot) was running fine and with trim active, about 90% of the times I connected any USB device (thumb drive, externally powered audio interface, webcam and many others) it threw the same message as mentioned above. I eventually gave up with the SSD and reverted to the micro SD.

This did happen ~12 months ago and at the time was willing to consider power was an explanation - perhaps the PI4 with the official supply was not able to maintain supply to the SSD even though it was essentially the only load on the PI4 USB bus.

I also encountered the same issue when the SSD was connected through the powered hub. It did seem that the SSD/USB interface was interrupted by the USB plugging activity.

Since I was unable to really debug the issue and the SSD became unusable due to the resulting corruption my only recourse was to revert to the SD card.

LTolledo
Posts: 5542
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Disconnect when connecting USB while using an external disk

Fri Jun 11, 2021 3:11 pm

due to extremely limited info on the OP's setup.... the usual suspect will always be

insufficient power

if OP does not provide more detailed info.... this will hold its ground (and wont budge!)
meanwhile... other "wild guesses" continue......
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

bjtheone
Posts: 1400
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Disconnect when connecting USB while using an external disk

Fri Jun 11, 2021 3:15 pm

I have a 4B that runs the OS and data off a SSD, that is directly connected to a USB3 port. I have a powered USB3 hub connected to the other USB3 port. The Pi is powered by an official Pi P/S. This Pi gets used as a desktop and run in an always on, always logged in setup. It goes months, sometimes many months, between reboots.

I frequently connect and disconnect SSDs, HDs and USB data sticks to the hub. I have had exactly zero issues with random disconnects. Storage devices I use range from microSD cards in USB adaptors (8-256 GB), USB data sticks (16-256 GB), SSDs (64-256 GB) with ASMedia based SATA/USB adaptors, various SATA hard drives (120GB - 1TB) with ASMedia based SATA/USB adaptors. Typically I only have one storage device connected to the hub at a time, but I have had 2 connected and moved significant volumes of data (+200 GB) from one to the other on occasion. Max storage devices connected to the hub at once I can recall is 3.

I have connected some USB audio widgets as well without any issues.

parkspark
Posts: 4
Joined: Fri Jun 11, 2021 9:00 am

Re: Disconnect when connecting USB while using an external disk

Mon Jun 14, 2021 1:16 am

bjtheone wrote:
Fri Jun 11, 2021 12:37 pm
First off we need some background information: what Pi, what OS, and any configuration changes you have made. Next up some details about the actual storage devices would be helpful.

Then we need information on how are you mounting these? With a default config and the current RPiOS, USB based storage will automount. The expectation is that you unmount (eject) it before removal. Odd things will occur if you just unplug mounted file systems.

If multiple USB based storage devices are present at boot, the names are not consistent, they are mounted in the order they are seen. The system will treat USB memory devices and USB connected SSDs the same. You can change this behaviour by manually mounting via the fstab, however this will only work for always connected devices.

Lastly, what are you trying to do and what behaviour would you like?
Background Information is

Board : Raspberry Pi 4 Model B Rev 1.2
OS : Raspbian GNU/Linux 10 (buster)
Kernel : Linux raspberrypi 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l GNU/Linux
SSD : Sandisk Extreme Portable SSD E60 (1TB) sdc1 exfat format
USB Card Reader OTG Hub : sdb1 vfat (/boot part) , sdb2 ext4 (/ part)
(For Test insert another SD Card (Rasbian Installed) Sandisk Ultra 16G A1 class )
Power : 5V 3A

When setting fstab, it does not boot when ssd is not connected, so try another method.
ssd mount command on rc.local

"sudo mount -t exfat /dev/sda1 /media/pi/ssd_disk

/boot/config.txt
disable set wifi & bt

I want to copy the data from already connected ssd disk to the newly connected usb disk.


need more information ?

thanks

parkspark
Posts: 4
Joined: Fri Jun 11, 2021 9:00 am

Re: Disconnect when connecting USB while using an external disk

Mon Jun 14, 2021 1:22 am

bjtheone wrote:
Fri Jun 11, 2021 3:15 pm
I have a 4B that runs the OS and data off a SSD, that is directly connected to a USB3 port. I have a powered USB3 hub connected to the other USB3 port. The Pi is powered by an official Pi P/S. This Pi gets used as a desktop and run in an always on, always logged in setup. It goes months, sometimes many months, between reboots.

I frequently connect and disconnect SSDs, HDs and USB data sticks to the hub. I have had exactly zero issues with random disconnects. Storage devices I use range from microSD cards in USB adaptors (8-256 GB), USB data sticks (16-256 GB), SSDs (64-256 GB) with ASMedia based SATA/USB adaptors, various SATA hard drives (120GB - 1TB) with ASMedia based SATA/USB adaptors. Typically I only have one storage device connected to the hub at a time, but I have had 2 connected and moved significant volumes of data (+200 GB) from one to the other on occasion. Max storage devices connected to the hub at once I can recall is 3.

I have connected some USB audio widgets as well without any issues.

Thank you for answer.
I'm going to try using a USB hub with a separate power supply.

parkspark
Posts: 4
Joined: Fri Jun 11, 2021 9:00 am

Re: Disconnect when connecting USB while using an external disk

Mon Jun 14, 2021 1:26 am

pidd wrote:
Fri Jun 11, 2021 1:58 pm
You are temporarily running out of power when you connect the extra device as the new device charges its capacitors.

You could used a powered hub to alleviate the problem.

Occasionally using an un-powered hub for "live" connections helps as it can limit the inrush current or provide extra reserve power.
thanks for your answer I'll try powered hub

Doug_
Posts: 72
Joined: Tue Oct 08, 2019 6:40 pm

Re: Disconnect when connecting USB while using an external disk

Thu Jun 17, 2021 2:40 am

Thanks bjtheone - I wish I could say the same but not my experience. To clarify I have had no random disconnects, only when plugging or unplugging the USB device. My SSD is SanDisk SSD Plus 240GByte., Eluteng USB/SATA i/f and PI4 4G Rev1.1 .
I too will try another powered hub.

bjtheone
Posts: 1400
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Disconnect when connecting USB while using an external disk

Thu Jun 17, 2021 12:00 pm

Doug_ wrote:
Thu Jun 17, 2021 2:40 am
Thanks bjtheone - I wish I could say the same but not my experience. To clarify I have had no random disconnects, only when plugging or unplugging the USB device. My SSD is SanDisk SSD Plus 240GByte., Eluteng USB/SATA i/f and PI4 4G Rev1.1 .
I too will try another powered hub.
What happens? Do you get spontaneous reboots or issues right after you plug in the SSD? If so it is likely a power issue. Stock RPiOS and automouter or manual mounting and unmounting?

My setup has OS & data on SSD, which is plugged in left in (obviously), listed in fstab. This SSD is directly connected to one of the USB 3 ports. All my other storage devices are connected via a powered USB 3 hub. These devices are automounted, and I always eject prior to physical disconnect. I have 2 HDD, 2 SSD, and a random number of USB data sticks and microSD cards in USB adaptors that get connected & disconnected, plus the odd device from friends and family when I am fixing stuff for them. I have never had an issue since I got my first first Pi, a 3B+. I ordered the 4B on release day in 2019 and moved my desktop setup to it. It has always been running 24/7 since then.

Doug_
Posts: 72
Joined: Tue Oct 08, 2019 6:40 pm

Re: Disconnect when connecting USB while using an external disk

Sat Jun 19, 2021 2:31 pm

I had pretty much the same configuration and run 24/7, the error was the same as the OP, 'Dsik was removed without ejecting, Please use menu to eject before removal' . With the bonus of file corruption on the SSD.

I am going to get a better powered USB hub before I try again - I'm willing to suspect I still have power issues. In the mean time the system continues to run (but a bit slow) as my day to day pc running from the microSD card.

Return to “General discussion”