Cannot reboot if a drive named "New Volume" is mounted due to the space character

Report Bugs, Issues and non- package Requests
Message
Author
Dwedit
Posts: 23
Joined: Sun Sep 01, 2019 6:52 pm

Cannot reboot if a drive named "New Volume" is mounted due to the space character

#1 Post by Dwedit »

I am having an issue with MX Linux.

When I try to reboot, the reboot process fails with an error that it is unable to unmount "New040Volume", then then fails to unmount the rest of the filesystem. I need to REISUB to safely reboot the computer.

Photo of error message:
umount_error.png
Text of error message:
umount: can't unmount /media/demo/New040Volume: No such file or directory
umount: can't unmount /aufs: Device or resource busy
umount: can't unmount /boot-dev: Device or resource busy
umount: can't unmount /media/demo/New040Volume: No such file or directory
umount: can't unmount /aufs: Device or resource busy
umount: can't unmount /boot-dev: Device or resource busy
umount: can't unmount /media/demo/New040Volume: No such file or directory
umount: can't unmount /aufs: Device or resource busy
umount: can't unmount /boot-dev: Device or resource busy
df: /media/demo/New\040Volume: No such file or directory
You do not have the required permissions to view the files attached to this post.

User avatar
fehlix
Developer
Posts: 12851
Joined: Wed Apr 11, 2018 5:09 pm

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#2 Post by fehlix »

Dwedit wrote: Sat Nov 16, 2019 3:56 pm When I try to reboot, the reboot process fails with an error that it is unable to unmount "New040Volume", then then fails to unmount the rest of the filesystem. I need to REISUB to safely reboot the computer.

Photo of error message:

Text of error message:
umount: can't unmount /boot-dev: Device or resource busy
df: /media/demo/New\040Volume: No such file or directory
Seems to be one of those famous bugs where someone has missed to handle spaces in filenames/lables properly.
OK, I can reproduce the un-mount error - but you shall also see a message "Press Enter to reboot", as shown here:
New_Colume_Unmount_error.png
You do not have the required permissions to view the files attached to this post.

Dwedit
Posts: 23
Joined: Sun Sep 01, 2019 6:52 pm

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#3 Post by Dwedit »

Mine gets stuck there and doesn't proceed to Press Enter to Reboot.

User avatar
BitJam
Developer
Posts: 2303
Joined: Sat Aug 22, 2009 11:36 pm

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#4 Post by BitJam »

Thanks for the report!

I think I fixed the space problem. I don't know if there are other problems. You will need to unpack the live initrd, replace the /bin/live-umount script and then repack it.

PS: I'm assuming you're using a full-featured live-usb made with *live-usb-maker. If you are using a read-only live-usb then we cannot change it. But even then you can cp live-umount to /live/bin on the running live system to see if it works for the next shutdown/reboot.

On M-X19 the unpack-initrd script is in /usr/local/bin which should be on your PATH. If you are running an older version of MX then you can find it in /usr/local/lib/cli-shell-utils/bin/ and it should be in /live/bin if you're running live.

You can update the live initrd running live or from a host. It's actually easier to do it live (and far more exciting!)

Download the attached tarball. Unpack it with:

Code: Select all

tar xzf live-umount.tgz
This will give a copy of the new live-umount executable.

When running live, you can update your initrd with these commands:

Code: Select all

unpack-initrd
sudo cp -i live-umount initrd/bin/
sudo unpack-initrd -r
The cp command should ask you if you want to over-write the file. You should say "yes".

You can also copy the live-umount file to /live/bin to use it for the current shutdown/reboot:

Code: Select all

sudo cp -i live-umount /live/bin
In fact, it might be safer to try this first because this change is not permanent.

Updating the live initrd on a host system
If you want to update the initrd on a host system then you need a copy of the unpack-initrd script. If you don't have one (see above) you could boot the live system and copy the script to your ~/Live-usb-storage/ directory:

Code: Select all

cp /live/bin/unpack-initrd ~/Live-usb-storage/
Assume the live-usb is mounted at /media/user/live-usb. Then run:

Code: Select all

cp /media/user/live-usb/Live-usb-storage/demo/unpack-initrd .
./unpack initrd -f /media/user/live-usb/antiX/initrd.gz
sudo cp -i live-umount initrd/bin
sudo ./unpack-initrd f /media/user/live-usb/antiX/initrd.gz -r
Note: I always use up-arrow to run unpack-initrd the second time. I add the "-r" at the end and the "sudo" at the beginning of the line.
You do not have the required permissions to view the files attached to this post.
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."

-- Richard Feynman

bled
Posts: 58
Joined: Mon Mar 07, 2016 12:06 pm

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#5 Post by bled »

also, do not create one folder
with name 'new' ... the word 'new'
can crash complet system...

User avatar
JayM
Posts: 6796
Joined: Tue Jan 08, 2019 3:47 am

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#6 Post by JayM »

bled wrote: Sun Nov 17, 2019 1:56 am also, do not create one folder
with name 'new' ... the word 'new'
can crash complet system...
Nonsense. I have several folders with names containing the word "new". That word has nothing to do with the original issue which is that spaces in a volume's label aren't being handled correctly. The work-around is that when you label a partition don't use spaces in its name, use underscores.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
mxer
Posts: 245
Joined: Fri Sep 21, 2018 9:09 am

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#7 Post by mxer »

Just for info.

White space - space & tab - are considered separators between arguments to programs, so must be 'quoted' if used elsewhere.
https://www.tldp.org/LDP/abs/html/special-chars.html
(FOSS, Linux, & BSD since 1999)

Dwedit
Posts: 23
Joined: Sun Sep 01, 2019 6:52 pm

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#8 Post by Dwedit »

Thank you very much, the fixed umount script did indeed resolve the problem that happened due to space characters, and I was able to apply the changes and remaster.

I ran into a minor issue with the "unpack-initrd" script. It was hardcoded to look for "/live/boot-device/antiX", and that's not where my system was installed. It was in "/live/boot-device/antiX-Frugal-4.19.0-6-amd64" instead, but it was easy enough to edit the script to change that. As for why I'd have a frugal install with a non-matching path, It could be because I deleted the root persistance file.

I'm now having another issue.
If I had any SMB/CIFS shares mounted, then rebooting silently freezes with no error messages, and I need to REISUB. I have not tried registering the network share in fstab. It may be happening because the wifi network disconnects before the share is unmounted, but I'm not certain about that.

Steps to reproduce on my system: (open a terminal)
su
cd /mnt
mkdir share
mount.cifs //servername/sharename share
Attempt to reboot.

User avatar
BitJam
Developer
Posts: 2303
Joined: Sat Aug 22, 2009 11:36 pm

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#9 Post by BitJam »

Dwedit wrote: Sun Nov 17, 2019 5:47 pm Thank you very much, the fixed umount script did indeed resolve the problem that happened due to space characters, and I was able to apply the changes and remaster.
Excellent!

BTW: you do not need to remaster to save changes made to the initrd.gz file. There are three main files need to boot live and by default they all exist in the /antiX/ directory but this can vary for example if you make an encrypted live-usb. The three files are:
  • initrd.gz -- a small "bootstrap" file system for setting up the main file sytem
  • linuxfs -- the main file system, compressed
  • vmlinuz -- the kernel
A live-remasters rebuilds the large linuxfs file but leaves the other two untouched.
I ran into a minor issue with the "unpack-initrd" script. It was hardcoded to look for "/live/boot-device/antiX", and that's not where my system was installed. It was in "/live/boot-device/antiX-Frugal-4.19.0-6-amd64" instead, but it was easy enough to edit the script to change that.
That is what the -f (--file) command line parameter is for. IMO that's much better than hard-coding the change. YMMV. If you're running live I could also look in the /live/config/initrd.out file to try to find the location.
As for why I'd have a frugal install with a non-matching path, It could be because I deleted the root persistance file.
Whatever works for you. We tried to make the system very flexible with regard to the boot directory.
I'm now having another issue.
If I had any SMB/CIFS shares mounted, then rebooting silently freezes with no error messages, and I need to REISUB. I have not tried registering the network share in fstab. It may be happening because the wifi network disconnects before the share is unmounted, but I'm not certain about that.

Steps to reproduce on my system: (open a terminal)
su
cd /mnt
mkdir share
mount.cifs //servername/sharename share
Attempt to reboot.
Can you use <ctrl><alt><F1> to switch to the first virtual console and see what is printed out there? This might give us a clue to where the problem is. You could also add the "uverb=7" boot parameter to get more printed out during shutdown.
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."

-- Richard Feynman

Dwedit
Posts: 23
Joined: Sun Sep 01, 2019 6:52 pm

Re: Cannot reboot if a drive named "New Volume" is mounted due to the space character

#10 Post by Dwedit »

I saw no errors on the first terminal, but I'll take a photo anyway.

There's a screen clear that happens during shutdown, so all I have is what's left on the screen.
no_error.jpg
Will I need to capture the contents of the screen just before the screen clear?
You do not have the required permissions to view the files attached to this post.
Last edited by Dwedit on Sun Nov 17, 2019 7:54 pm, edited 1 time in total.

Post Reply

Return to “Bugs and Non-Package Requests Forum”