My current portable setup consisted of an external hard drive used as a bootable usb disk. I have multiple distros on it and it works well except when the hard drive is accidentally disconnected. Linux brings up tty and starts giving error messages. I am still to be able to re-mount the hard drive (by plugging it in again) but it mounts as a different device (/dev/sdY instead of /dev/sdX). Is there a method to insure that linux continues to operate without reboot even after re-mounting root device?

I didn't clearly explain the issue I was having. I am able to boot and use ubuntu off of the external hard disk all fine. what is going on is that when the external hard disk is accidentally disconnected, linux brings up the console (that doesn't respond to keyboard/mouse input events) and prints error messages like this...
inital messages when unplugged an probe messages
more messages...

and when I re-plug the external hard drive, I see that the hard disk mounts on /dev/sdb (originally on /dev/sda). My hunch is that since the external hard disk was mounted on / and wasn't properly umounted, linux still thinks the hard drive is there but can't be reached. I believe that if I can make the kernel somehow believe that the newly re-plugged hard drive is /dev/sda (or the original drive mounted on /), linux can resume operations. It seems that some part of the kernel has already been loaded on to ram because devices are still able to mount and linux still seems to be searching for the root device. also note the time stamps in seconds on the far left of the each log entry (10,000 seconds...); ya I believe if the computer still has power, the kernel on ram will continue to unrelentingly probe for the root device (some dedication huh).
same as top but after re-plugging drive(notice messages on the bottom)
back to probing for root device

I have noticed that even if I were to re-plug the external hard drive during a certain time during the boot process, linux boots properly. I can do more experiements if needed
re-plugging during the logs before welcome to ubuntu 17.04 message doesn't hinder boot

what I ultimately wish for is that on the unexpected event of disconnection of the external hard drive, I can re-plug the external hard drive and resume linux operation as if it wasn't disconnected. what are my options? Is there a method to do this? do I need a custom kernel?

Parallel post on ubuntu forums

  • Boot in RAM? (toram), but anything not saved won't be saved after shutdown. I have never had good luck just plugging the drive back in. – C.S.Cameron Jul 26 '18 at 20:30
  • Are the OS on the external drive Full installs or Live / Persistent installs? – C.S.Cameron Jul 28 '18 at 1:10
  • @C.S.Cameron ya the full OS along with grub in on the external drive. it is basically a full fledged hard disk that if I want, I can connect directly via SATA ports to computer. – Joann Morris Aug 1 '18 at 7:17
  • Sorry, haven't had any luck. when I unplug a Full install the desktop starts to dissolve. When I unplug a running toram Persistent install, I have been able to save the work to a different drive. This seems better than loosing work. Add one for persistence in the debate over Persistent vs Full install to USB. – C.S.Cameron Aug 3 '18 at 0:37
  • @C.S. Cameron so on the Persistent install, are you able to unplug and re-plug and continue operation as well? – Joann Morris Aug 3 '18 at 23:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.