USB accdental unplugs

Post here if you are a new Porteus member and you're looking for some help.
biotec
White ninja
White ninja
Posts: 27
Joined: 23 Jan 2014, 23:50
Distribution: slackware
Location: Oviedo

USB accdental unplugs

Post#1 by biotec » 28 Mar 2016, 18:17

Hi !

It is really great running Porteus entirely from an USB stick ... except when the usb connector is loose and the stick gets accidentally disconnected: even for a fraction of a second, the system becomes unstable and any unsaved work will be lost, which is not funny. As the persistence file does not cleanly unmount, you also get chances that the file becomes corrupted (fortunately, this does not always happen). I believe that the kernel can handle this (see Documentation/usb/persist.txt), but it doesn't work for me, and when the usb is unplugged and immediately replugged, the USB instance is changed and the stick remount on a new /dev/sdcX.

Has anyone dealt with this situation? I'll be pleased to hear an try any suggestion that could make USB more resilient (a fashionable word lately 8) ).

Congrats to the Porteus team for the great tool we enjoy. :Bravo:

Thanks.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: USB accdental unplugs

Post#2 by Bogomips » 28 Mar 2016, 19:57

Running in RAM, have had this problem with an iffy usb stick. At some time have not been able to access data on the usb. Had to put in another slot, then what was /mnt/sdb2 became /mnt/sdc2. Overcame this by using a symbolic b2 like so, using CLI, and as SU:

Code: Select all

mkdir  /b2
mount -U 30e88aba-c81c-49ea-9e9b-d23edd56b578 /b2
using the UUID of the device, which is found by

Code: Select all

guest@porteus:~$ /sbin/blkid
...
/dev/sdc1: UUID="ab55fc94-4882-417b-b173-7f159944fa9b" TYPE="ext2" PARTUUID="e37d92f4-01"
/dev/sdc2: UUID="30e88aba-c81c-49ea-9e9b-d23edd56b578" TYPE="ext4" PARTUUID="e37d92f4-02"
So now instead of /mnt/sdb2 (which would be misleading}:

Code: Select all

guest@porteus:~$ ls /b2
Flm/       Prolog/  gmp/        init/  lost+found/  skype/
PaleMoon/  cinn/    gnomeplay/  iso/   mods/        usm/
Hope this gives some idea of how to recover.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

ztrapl
Contributor
Contributor
Posts: 198
Joined: 29 Aug 2013, 21:36
Distribution: Porteus 3.1 KDE4 32bit
Location: Czech Republic

Re: USB accdental unplugs

Post#3 by ztrapl » 28 Mar 2016, 22:20

@Bogomips
I also already happened, that I disconnected the usb drive, but I have not found a solution.
I tried Your steps and it works.
Thanks.

And so I tried this experiment:

Code: Select all

root@porteus:~$ /sbin/blkid
....
/dev/sdc1: UUID="D4E6-3A8F" TYPE="vfat"
I entered the command:

Code: Select all

mount/dev/sdc1
And it also works.

User avatar
wread
Module Guard
Module Guard
Posts: 1255
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v5.0-kde-64 bits
Location: Santo Domingo
Contact:

Re: USB accdental unplugs

Post#4 by wread » 02 Apr 2016, 19:24

I bought me a new computer, it doesn't happen any more... :D
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!

biotec
White ninja
White ninja
Posts: 27
Joined: 23 Jan 2014, 23:50
Distribution: slackware
Location: Oviedo

Re: USB accdental unplugs

Post#5 by biotec » 02 Apr 2016, 21:44

@Bogomips, thanks for the tip. I've been considering running from RAM ..., but I believe the risk can be too high in my case: I have 30 to 40 people doing exercises on their respective laptops running Porteus from an USB stick provided by me; at the end of the session, once they switched off their laptops, they just hand me back the USB, which has porteussave.dat with their work saved on it. The risk of running on RAM is that any unsuccessfully handled failure (during the session or at the end) would lead to loosing the whole session for sure. Besides, some of their laptops might not have enough RAM for that. With my present setup, not running from RAM, power failures, accidental disconnections, or hangups do not always lead to loosing the entire session, so until I find a better solution, I'll keep on running from the USB. Regards.

Post Reply