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?
UPDATE
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?
0 Answers