Page 1 of 1

USB accdental unplugs

Posted: 28 Mar 2016, 18:17
by biotec
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.

Re: USB accdental unplugs

Posted: 28 Mar 2016, 19:57
by Bogomips
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.

Re: USB accdental unplugs

Posted: 28 Mar 2016, 22:20
by ztrapl
@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.

Re: USB accdental unplugs

Posted: 02 Apr 2016, 19:24
by wread
I bought me a new computer, it doesn't happen any more... :D

Re: USB accdental unplugs

Posted: 02 Apr 2016, 21:44
by biotec
@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.