LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-21-2020, 09:07 AM   #1
jan128
Member
 
Registered: Nov 2020
Posts: 201

Rep: Reputation: Disabled
unmout - invalid argument ??


I made an error applying "mount" and now I cannot use "umount" .

What am I doing wrong?


Code:
sdl       8:176  1  28.9G  0 disk 
├─sdl1    8:177  1   9.8G  0 part /media/c/sdl
└─sdl2    8:178  1   9.8G  0 part /media/c/sdl

c@c-SATA:~$ sudo umount /dev/sdl
umount: /dev/sdl: not mounted
c@c-SATA:~$ sudo umount /dev/sdl1
umount: /dev/sdl1: umount failed: Invalid argument
c@c-SATA:~$
 
Old 12-21-2020, 09:12 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
And what is the output of df?
 
Old 12-21-2020, 09:14 AM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by jan128 View Post
I made an error applying "mount" and now I cannot use "umount" .

What am I doing wrong?


Code:
sdl       8:176  1  28.9G  0 disk 
├─sdl1    8:177  1   9.8G  0 part /media/c/sdl
└─sdl2    8:178  1   9.8G  0 part /media/c/sdl

c@c-SATA:~$ sudo umount /dev/sdl
umount: /dev/sdl: not mounted
c@c-SATA:~$ sudo umount /dev/sdl1
umount: /dev/sdl1: umount failed: Invalid argument
c@c-SATA:~$
The first error is because you cannot unmount the device for for the entire drive, anymore than you can mount it. /dev/sdl is the device node for the drive as a whole.

You've also got two partitions mounted to the same mount point, you shouldn't be doing that - which could explain the second error.
 
1 members found this post helpful.
Old 12-21-2020, 09:26 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
To correct this, you need to umount in reverse order of the two mounts. The second one is preventing you from umounting the first. Just do:

Code:
sudo umount /media/c/sdl
sudo umount /media/c/sdl
Aft that just do the mount you want.
 
Old 12-21-2020, 09:28 AM   #5
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by jan128 View Post
I made an error applying "mount" and now I cannot use "umount" .

What am I doing wrong?


Code:
sdl       8:176  1  28.9G  0 disk 
├─sdl1    8:177  1   9.8G  0 part /media/c/sdl
└─sdl2    8:178  1   9.8G  0 part /media/c/sdl

c@c-SATA:~$ sudo umount /dev/sdl
umount: /dev/sdl: not mounted
c@c-SATA:~$ sudo umount /dev/sdl1
umount: /dev/sdl1: umount failed: Invalid argument
c@c-SATA:~$
To clarify what was said by jsbjsb001.

When devices are mounted on "top" of another, they must be unmounted in the reverse order.

It is likely you mounted first /dev/sdl1 then /dev/sdl2 so to umount them it would require first umount /dev/sdl2 then /dev/sdl1.
To avoid the confusion maybe you could have done a "umount /media/c/sdl" instead as that should unmount the last one mounted first. You would need to repeat that to unmount both.
 
Old 12-21-2020, 10:23 AM   #6
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
Thanks for replies.
I "fixed" the issue by removing the USB device and plugging it in again.
Then I got /dev/sdm instead of expected /dev/sdl.

After that did build the mount points / folders

and mounted both partitions using

sudo mount /dev/sdm1 /media/c/sdm1
sudo mount /dev/sdm2 /media/c/sdm2

lsblk shows the mount points

sdm 8:192 1 28.9G 0 disk
├─sdm1 8:193 1 9.8G 0 part /media/c/sdm1
└─sdm2 8:194 1 9.8G 0 part /media/c/sdm2

However
gparted now shows TWO mount points
one being a "labeL" I added in gparted and the other the one I did using mount.

I expect the "label" to be used by file manager, but...

Not only that
file manager shows the "label" and TWICE for each partition .
My guess is one for sdl and the other sdm.

Nice unusable mess.

Any suggestion how to start over ?

How about
unplug USB
run lsblk
reboot
run lsblk
plug-in USB
check gparted for it
add labels
mount device
run lsblk
check gparted for it
copy downloaded file to new device partition
and hope it works


All I want to have USB device with partitions accessible by file manager I can install application into.
 
Old 12-21-2020, 02:58 PM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
how about:
unmount both partitions
unplug device
reboot (this clears out any errors in mtab or block device identifiers)
plug in device
lsblk
check gparted and add/change label and UUID if desired
unplug device
(wait about 1 minute or more)
plug in device
lsblk
If it looks right mount partitions as desired
copy files as desired.

Note that a USB device will take the next unused sdX as you already have seen. Mounting it with device name from fstab (or from the command line) will not always work if the name changes, but mounting it with UUID will always correctly identify the proper partition to mount.
 
Old 12-21-2020, 11:02 PM   #8
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
@jan128,

Just something else in addition to what's already been said; you don't need to mount removable media (such as a USB stick for example) as root (ie. using sudo), you can in fact mount removable media under your normal user account. That is actually better, and your desktop environment's "automounter" would already do it that way when you insert a USB stick for example (if you haven't disabled the automounter, that is).

Usually, drives mounted under root would be fstab mounts or similar, not things you've mounted after the boot/startup process has finished and you're at the desktop.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unmout web cam without disconnecting williepabon Ubuntu 7 03-24-2013 12:55 PM
What does Mount and Unmout do in Linux? John Glasgow Linux - Newbie 7 01-02-2012 09:49 AM
message sending failed : Error[22 ] invalid argument .....but each and every argument rakeshranjanjha Linux - Software 2 01-07-2008 11:22 PM
Wierd auto-unmout prob 2Pacalypse Linux - Hardware 6 03-13-2007 03:25 PM
Allow only a user to mount and unmout drives Menestrel Linux - Newbie 6 07-24-2005 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration