I'm booting Linux from a USB flash drive on my laptop. Everything runs fine until I put the laptop to sleep. When it wakes up, suddenly the USB flash drive gets a different device name, and everything starts failing, because the already mounted file system is now on a device that no longer exists. How do I make Linux keep the device at the same device name when it wakes up?
I cannot tell you how to keep it from changing its device name -- but still there might be a solution to your problem. Before doing the following changes, just for safety make a backup of your
First, check your
And after wakeup, your drive changed to
Now check which of the entries there is pointing to
Now you can tell the device's unique id. Go back to your
Now it should no longer matter which "device name" your USB drive has, as it is identified by its unique id which is not subject to change.
Using a LiveCD image on an USB stick, things may look a little different, as
(hint for the names:
Depending on what Linux you're running you may find that simply naming the USB flash drive does what you're after. For instance, if you give the drive the file system label
If that doesn't work then you can use