USB disconnections

Post here if you feel others can duplicate your so discovered "bug"

Moderator: Forum moderators

Post Reply
Clarity
Posts: 3850
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1634 times
Been thanked: 528 times

USB disconnections

Post by Clarity »

This can be termed a BUG, but maybe a designed misunderstanding.

When a USB stick is disconnected from ANY modern PC since 2000, the system detects and know of it.

So, if it 'was' mounted, it is no longer mounted and its mount-point is now a phantom in the system.

Shouldn't the PUP distro release the phantom left by the USB disconnecton when the USB is removed as should be expected?

IS this a bug?

User avatar
bigpup
Moderator
Posts: 7008
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 916 times
Been thanked: 1532 times

Re: USB disconnections

Post by bigpup »

Just to make sure.
You have unmounted the USB before removing it?

Is this in a specific Puppy version or everyone you have used?

You are talking about the mount-point still being in /mnt/ ?

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

Clarity
Posts: 3850
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1634 times
Been thanked: 528 times

USB disconnections is a BUG

Post by Clarity »

Hi @bigpup Answers: This is a phenom in PUPs when a USB is removed. Even if you re-insert the same USB back into the same port, the old mount-point will NOT be used leaving the phantom in the system.

If the device is removed, no matter if it was un-mounted or not, it is gone. So why should the PUP maintain a 'phantom'; namely the old mount-point? It serves NO meaningful purpose to the running future of the system nor the use/reuse of USB?

This is a bug in logic and implementation.

There must be a good reason why these phantoms remain after the mounted USB device is, physically, removed. Maybe it is something hardware or maybe its a coding artifact that lingers in the system.

Hopefully development will address this concern.

Even as this may be a bug, it is minor and does NOT crash the system.

User avatar
Phoenix
Posts: 341
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

Re: USB disconnections

Post by Phoenix »

The reason to not automatically unmount a forcibly removed device even when its no longer connected is because, what happens if your computer kicks out your own puppy USB? Particularly this applies if nocopy is used meaning the link is maintained to the USB. And the implementation will not permit you to unmount because aufs still has a leash on it. (Any sane layering filesystem should) It will set to read-only though to acknowledge that the device is no longer connected. Also why delete the mount-point folder when it could be reused? Its rather pointless to waste writes to create directories for mount-points that can be reused as the kernel automatically reuses device nodes (device nodes are temporary, they do not exist anywhere else) that are not used.

IRC: firepup | Time to hack Puppy!

Feek
Posts: 398
Joined: Sun Oct 18, 2020 8:48 am
Location: cze
Has thanked: 54 times
Been thanked: 90 times

Re: USB disconnections

Post by Feek »

Shouldn't the PUP distro release the phantom left by the USB disconnecton when the USB is removed as should be expected?
IS this a bug?

Hi Clarity,

I am also aware that after disconnecting the USB stick, its empty folder remains in /mnt.
I didn't consider it as a bug, even if I thought about the purpose a few times.

I'm now in Fatdog.
I inserted a USB stick, mounted it (sdb1), then unmounted and ejected.
Pfind shows that only one empty folder (/mnt/sdb1) remained in the system. Nothing more.

Then I inserted another USB stick.
The system named it again sdb1 and also assigned to the previously created sdb1 folder (in /mnt).

I already got used to it. No problem at all.

Clarity
Posts: 3850
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1634 times
Been thanked: 528 times

Re: USB disconnections

Post by Clarity »

Thanks @Feek. Yes, that is true regarding a device that is "unmounted" before ejection or removal.

BUT, if you remove/eject without, first, doing a unmount, then the mount-point become a phantom.

Phantoms have no purpose when the real device is gone from the PC's hardware.

User avatar
bigpup
Moderator
Posts: 7008
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 916 times
Been thanked: 1532 times

Re: USB disconnections

Post by bigpup »

So you are doing it wrong and wondering why the file system still has it as a mount point?

If you do not give the command to unmount it.
Why do you think when you remove it wrong, without first unmounting it.
It is going to auto unmount it and no longer have it a active mount point.

Puppy has never had auto unmount for unplugging a USB.

Puppy has never been much about doing anything automatically.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
greengeek
Posts: 1386
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 535 times
Been thanked: 192 times

Re: USB disconnections

Post by greengeek »

Clarity wrote: Sun Mar 13, 2022 12:36 am

Thanks @Feek. Yes, that is true regarding a device that is "unmounted" before ejection or removal.
BUT, if you remove/eject without, first, doing a unmount, then the mount-point become a phantom.

What happens when you do this in Windows?

User avatar
bigpup
Moderator
Posts: 7008
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 916 times
Been thanked: 1532 times

Re: USB disconnections

Post by bigpup »

Windows 10 since 218 has had the quick removal ability for USB drives.
Basically you just pull it out of the port.

However, now that USB drives are defaulted for “quick removal,” the system can no longer cache disk write operations, which results in slower performance.

So, this is basically why you need to first unmount before removal.
Puppy does use cache disk write operations.
So, if still writing to the USB, when you just pull it out.

You probably will get corruption and errors with incomplete files.

I have seen this happen.
I was putting large amount of stuff on a USB.
File manager showed it was completed.
But when I tried to unmount USB drive, it would not unmount.
Stuff was still being written to the USB drive from the cache.
A short time latter, after all was written from the cache.
USB drive would unmount.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

Clarity
Posts: 3850
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1634 times
Been thanked: 528 times

Re: USB disconnections

Post by Clarity »

More information on this bug is found on this ansxillary thread started after this Bug Report thread.

User avatar
Phoenix
Posts: 341
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

Re: USB disconnections

Post by Phoenix »

@Clarity Linux will not auto unmount even though you have forcibly removed it. This is not a kernel feature, it is a configuration feature present to the software used. (e.g udev).

Also umount will not permit 'unmount' if it happens that the device is in use. (via aufs or writing/reading) Until the system gives up on writing/reading or aufs releases it, you cannot release the device. (For example you can load in SFS on other partitions even though it suggests you copy to the home partition)

I believe its bad practice to auto unmount. It would encourage people to not damage or lose data unlike Windows which has dropped the caching function. We already have icons for unmounting and mounting, and since people now have to mount it stands to reason that they should have to unmount it themselves.

IRC: firepup | Time to hack Puppy!

Post Reply

Return to “Bug Reports”