SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have Current atm and this minor irritation in suspend. If I have a usb drive mounted when I hit suspend, it stays mounted as sdb1. When coming back from suspend, sdb1 is already taken, so it defaults to sdc1, which actually upsets a lot of things here.
I'm even irritated to contemplate using a UUID for sdb, but if it's not force unmounted, I don't know if it will solve anything.
Any ideas, or are there realities I have to work around?
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309
Rep:
Alternatively you may use suspend script to unmount and mount the device:
suspend
Code:
#!/bin/bash
# suspend: suspends the system to RAM
# check the present virtual terminal
FGCONSOLE=`fgconsole`
# switch to virtual terminal 12
chvt 12
### umount /mnt/sdb1
/sbin/hwclock --systohc
sync
# suspend-to-ram
echo -n mem > /sys/power/state
/sbin/hwclock --hctosys
### mount /mnt/sdb1
# switch back to virtual terminal running X
chvt $FGCONSOLE
***
Well, maybe I missed something but I just suspended the system with mounted USB drive using the above script without those umount and mount commands and when I resumed it USB drive was still mounted as /dev/sdb1.
Last edited by w1k0; 06-15-2019 at 07:55 AM.
Reason: maybe I missed something
Just wondering : what does "hit suspend" mean?
I haven't experienced this but use dbus to hibernate (I do not suspend often), not the direct suspend with root privileges...
Just wondering : what does "hit suspend" mean?
I haven't experienced this but use dbus to hibernate (I do not suspend often), not the direct suspend with root privileges...
Usually just hit the 'suspend' option in in XFCE. I have also used slackware's 'pm-suspend, & 'echo mem > /sys/power/state' but didn't notice either fixing the problem.
Alternatively you may use suspend script to unmount and mount the device:
[SNIP]
Well, maybe I missed something but I just suspended the system with mounted USB drive using the above script without those umount and mount commands and when I resumed it USB drive was still mounted as /dev/sdb1.
Very nice thank you.
I'll probably stick in an 'if' condition to check if sdb1 is actually mounted to save it spewing 'sdb1 not mounted' errors
@Didier Spaier: I was trying to figure out what the box would do when sdb1 was firmly mounted and it came across sdc1 with an identical UUID
Hey, Didier, I put that single UUID into /etc/fstab as /mnt/hd. To make a long story short, I could not mount it as anyone for love or money. 'mount /mnt/hd' failed as luser or root.
Was it the device uuid or the partition's uuid? Made the mistake a few times here...
Yeah, It's ease done. I did
Code:
bash-5.0$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Jun 17 10:26 28b17366-1d6e-4edf-80ae-9572932428d3 -> ../../sda6
lrwxrwxrwx 1 root root 10 Jun 17 10:26 31aa9e0e-fd75-4042-b6f6-e80eaf38c100 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jun 17 10:29 348661f5-73b1-49de-bcf0-deb0d538e045 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 17 10:26 74d16e12-be9b-41cd-aa8f-5ca2bb28c8cc -> ../../sda3
lrwxrwxrwx 1 root root 10 Jun 17 10:29 7BFBBA3513627C8B -> ../../sdc1
lrwxrwxrwx 1 root root 10 Jun 17 10:26 82042242-a5d5-472c-92fb-ab8fc0cb7814 -> ../../sda7
lrwxrwxrwx 1 root root 10 Jun 17 10:26 b813280e-533f-49dd-8759-1677795b2e17 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 17 10:26 f06b152f-9794-4af2-91b1-7405848c16c8 -> ../../sda2
then I copied the "348661f5-73b1-49de-bcf0-deb0d538e045" bit with the mouse and pasted it. Was that wrong? I generally avoid UUIDs for the reason that they're a PITA.
Here the uuid is the one of the file system. It will change if I create a new file system in the partition. So, better use parttuid instead (the UUID of the partition, not of the file system). For instance:
The advantage is that if you reformat the /dev/sdb3 (without modifying the partition table) its partuuid won't change, hence no need to modify /etc/fstab.
As an aside, patches have been proposed to search partitions by partuuid in GRUB. Unfortunately probably too late to be applied in incoming version 2.04
Clever idea, and thanks for that. I read that link. It may solve the remounting half of the problem, but it doesn't get it unmounted before suspend. We also have the question of what error the system would throw on the remount of an already mounted device/uuid on an already used usb port. But permissions are fussy; I need a root force-unmount, and a user remount, so the user can write to it.
At this stage I'm convinced the user will have to change his habits. There's the guts of a working solution between the script in post #3 (un-mounting) and your idea re-mounting. Frankly, by the time I implement that, there's probably an update due anyhow. I was hoping for something simple, and it's not out there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.