Linux - NewbieThis 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
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.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by jan128
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.
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.
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.
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.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
@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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.