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.
I am trying to correlate various tools I am learning to use - all about “mount”.
I got no problem with “mount” concept , however I fail to add it all together.
Let me start with this :
I have clean and empty test partitions I formatted , I have assigned “name” and “label to it.
All using “gparted” tool , without an issue.
Gparted does not assign mount points, so
I use “Disks” to “mount selected partition” as
Ext4 (version 1.0) — Mounted at /mnt/d8589477-2356-40f4-a7f1-e564aaa4af22
I check with “gparted” and the “mounted on media” is NOT /mnt/……. but
media/f/ <UUID >
1. why different mount folders?
2. does it mater ?
Nay comments to help me learn would be appreciated.
Chris, many thanks for reply.
My original was Ubuntu 16.04.6. Recently installed from ISO to sdc , several copies (different project), now upgrdedd to 16.04.7. I would not say "successfully upgraded" - having some minor annoying issues "watching CNN on Firefox, which used to work just peachy.
I did run all commands you have suggested. Since my system is about 5 years old and I have been adding hardware , it is a mess. I am currently waiting for large USB sticks to "back things up" (to get rid of aging SATA drives) and 1TB SATA drive so I have a clean OS too.
This "mounting problem" started with when lost control over building and auto mounting RAID on boot. I just cannot keep the md devices numbers and have to mount the arrays manually.
If it is OK with you - I shall concentrate on single drive - sdc - the one with functioning OS - I am sure somebody would get uptight if I post ALL outputs.
Here is one of the most readable outputs - using "parted", but it gives no mount point.
Perhaps another search for parted options is due.
Code:
Model: ATA WDC WD5000AAKS-7 (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 EFI System Partition boot, esp
8 538MB 114GB 113GB ext4
4 114GB 218GB 105GB ext4 RAID raid
5 218GB 277GB 58.3GB ext4
6 277GB 307GB 30.3GB ext4 UBUNTU_OS_16.04.7
7 307GB 351GB 43.9GB ext4
2 351GB 371GB 19.8GB ext4
9 371GB 496GB 125GB ext4 A_TEST_NAME
3 496GB 500GB 3981MB linux-swap(v1)
I have highlighted the current test partition and searching the "parted" man to see if I can add UUID as an option to output.
Here is the output from df -h, it identifies sdc9 by UUID and it was mounted by "Disks" to
/mnt folder - one of my questions about mounting to /media/user or /mnt - but latter.
External drives are automatically mounted by default by the desktop as /media/username/<UUID> or <LABEL>
By convention /media is for removable filesystems i.e optical disks and USB drives. /mnt is for temporary filesystems not necessarily removable. However, you can mount any filesystem on any drive where ever (almost... ) within the directory tree structure of your OS.
Here is the latest / verification / test.
I have used my real backup USB - was little nervous about using it.
At first it had only one partition and AFTER insert and reboot (?)
it came up as mounted as you said - using label (as specified in gparted ) .
Then I shrunk the partition and build another one and used "label" again .
Here is the result after another reboot - now I have UUID and no label.
"gparted" also shows mount point as UUID.
Your example for the mounting of sdk1 and sdk2 is exactly as expected. The label applied to a drive during auto-mounting is attached to the device, not the partition. Since you cannot have 2 devices mounted with exactly the same path and sdk1 was already mounted using the label the system fell back to the UUID for sdk2. A UUID must always be unique.
If you look at /dev/disk/by-label you can see the partition labels you have applied, and by putting those in the fstab file with LABEL=label for each partition you want to see mounted by label you can do that. The labels only show up here after the kernel is aware of any changes done in the partition table so a reboot is often recommended after changing partitioning on a device.
Testing this shows the actual partition name in the mount command after mounting though (/dev/nvme0n1p3 in my case). Using fstab would be the way to go when you want specified partitions mounted in a particular location for ease of access. The mount points could be named however you wished for identification.
As an example, I tried this to mount my NTFS partition on a special directory I created for the test.
My fstab entry
Code:
LABEL=OS /mnt/ntfs ntfs user,rw 1 2
and after saving that
As my user I did "mount -a" with the expected result. /mnt/ntfs contained my windows OS partition.
I was also able to "umount /mnt/ntfs" as my regular user.
To verify I was doing everything in the right way I used "man fstab" "man fstab 8" and "man mount" for very clear instructions on how things work.
Files is the default file manager for the Gnome desktop which was known as Nautilus.
With external media automatic bookmarks are created on the left side of the file manager and a shortcut on the desktop. Not so with other filesystems but you can create a bookmark.
Files is the default file manager for the Gnome desktop which was known as Nautilus.
With external media automatic bookmarks are created on the left side of the file manager and a shortcut on the desktop. Not so with other filesystems but you can create a bookmark.
Thanks, I really need to update my terminology.
I know about"nautilus" but never seen that name used anywhere in the system.
So when I run "Files" AKA "file manager' I get two pane "window /form".
It the left one I get an icon , folder mount point name or UUID , and another icon indicating if the folder is mounted.
Moving mouse over any of these I get "tool tip" - the actual mount point.
I am probably mixing windows and Linux terminology, but am I right - in principle ?
Ever since I start using Linux I have an issue with therm "external media" - I grew -up with Von Neumann computer
model where such distinction , assuming there are "internal media", was non-existent or even unnecessary.
I am tangling with similar term " removable device " now.
In my view - 8 inch floppy was pretty much removable then.
Thanks very much for your help, it is much appreciated.
Cheers
"files" is the user friendly name for the file manager AKA nautilus. I don't know where they got the name but it seldom matters to the user since you see it as files.
I could suggest that you create a mount point for each partition you wish to mount, and that you put them somewhere your user would have access. Possibly /home/user/mounts could be the parent directory then within /home/user/mounts you could create "files" "photos" "notes" "letters", etc. as directories you wish to use for mount points.
To continue with the flow, lets assume you have a partition /dev/sdg1 that contains your photos and you want to mount it at /home/user/mounts/photos.
You could assign /dev/sdg1 the label PHOTOS then enter in /etc/fstab a line such as
LABEL=PHOTOS /home/user/mounts/photos ext4 defaults 1 2
once mounted it would show to the mount command as /dev/sdg1 mounted at /home/user/mounts/photos, BUT in files you could click on home in the left panel, then double click on the mounts folder in the right panel and you would see the directories you created. Another double click on the photos folder there would show you the contents of that partition.
By doing this you would be able to see in fstab which partition (by label) is mounted where. Also in files you would easily see by name the content of that partition.
"Removable Device" is pretty much any CD/DVD/USB flash/SD card/USB attached hard drive/etc. and applies to almost anything that is not permanently part of the hardware. Since so many things are now a days removable they had to develop a way to handle when it is attached and when it is removed. That includes the file manager which has to show it when auto mounted (after it is attached) and allow the user a way to access it and also safely remove it when no longer needed.
Thanks for the post, much appreciated.
I have made several wrong assumption on my last , and first, series of posts.
I generally try to post single subject.
It seems there is always some information missing in my post.
But my first and probably last series of posts are all related and that why if became "uninformative" mess.
Anyway , enough rant.
I am basically a lazy person and subscribe to KISS theory.
My main tool to manipulate files / folders has been "gparted".
It does OK job at basics.
The "problem" started when I decided to play with RAID.
Unfortunately after RTFM , one of many, they all missed one simple task -
how to activate, make accessible , RAID array after boot.
Then I had to get out of my comfort GUI gparted zone to many "command tools".
One of the fist , and still unanswered issues,is when I use "mdadm " to assign "/dev/mdx".
At one point, still unidentified, my /dev/mdx often changes to /dev/md127 or to "name / label " as assigned in "gparted". ( Yes I posted this specific problem, do no recall where, but no solution was found )
And from that point it is usually "down hill" uncontrollable slide full of errors
irregardless which command tool I use.
The "problem" started when I decided to play with RAID.
Unfortunately after RTFM , one of many, they all missed one simple task -
how to activate, make accessible , RAID array after boot.
Then I had to get out of my comfort GUI gparted zone to many "command tools".
One of the fist , and still unanswered issues,is when I use "mdadm " to assign "/dev/mdx".
At one point, still unidentified, my /dev/mdx often changes to /dev/md127 or to "name / label " as assigned in "gparted". ( Yes I posted this specific problem, do no recall where, but no solution was found )
And from that point it is usually "down hill" uncontrollable slide full of errors
irregardless which command tool I use.
Cheers
Using raid with mdadm has been a steep learning curve for me. I wanted my entire /home on raid5 and even after having used raid several years ago I had to relearn how to make that happen. Then after having 2 different drives fail (at different times) I decided to convert my raid5 array to raid6 to be more fault tolerant and that required some additional research as well. With raid 5 a single device failure is OK and can be recovered; 2 devices fail simultaneously and the array is toast. With raid6 it is more fault tolerant and can be recovered even with 2 devices that fail simultaneously.
Luckily I was able to search the internet and found that there are many posts out there both for "how to" and for troubleshooting (on just about any subject). With careful reading and study I was able to educate myself and do what was needed.
One of the biggest drawbacks to depending on gui tools is that they have certain programmed in features that work for most users, but sometimes may not accomplish 'your' tasks. When that happens it often is simpler, as you have seen, to use the command line tools and get the job done your way. So with Linux you have the best of both worlds -- gui tools for everyday operations and cli tools for specialized operations (or for those admin tasks the average user never needs). With M$ systems you only get the gui and thus can only do what someone else allows you to do.
Update:
On raid arrays mdadm by default creates "md127" and counts up as additional arrays are created. However it is quite possible to name the array as you choose when you create it. From "man mdadm" I found
Code:
CREATE MODE
Usage: mdadm --create md-device --chunk=X --level=Y
--raid-devices=Z devices
This usage will initialise a new md array, associate some devices with it, and activate the array.
The named device will normally not exist when mdadm --create is run, but will be created by udev once the array
becomes active.
Research will assist with that.
Personally I am much happier with searching and learning things (I don't forget them) than I am with being told "how to" (I often forget).
Last edited by computersavvy; 11-07-2020 at 10:26 AM.
...and that is a "problema" - "md" has at least three options how to designate it -
literary "md-device" is not one of them.
so it is easy to miss, if one does not read "fine print" to find XYZ are symbols for number.
The named device will normally not exist when mdadm --create is run, but will be created by udev once the array
becomes active.
And that is another awkward one - both create and run are valid options - so "run --create "(?) , if one looks for precise and readable English , is not the best expression.
I actually see how the above sentence MAY explain some of the problems.
My interpretation of "--create" is - it creates (!) "md" device , it has to be created for some other function to use it.
But the sentence , to me , reads "udev" creates the "md" device...after it is active...AKA "--create" does not create it.
Logically - how it can be active if it does not have a device yet ?
This is what I have been questioning from get-go - how it ties all together?
Of course the usual answer is - RTFM.
Actually - literal translation of RTFM
" Do not bother me, I do not know the answer ".
Yes, English is not my native language and I often get stuck trying to "translate" some common expression.
Usage: mdadm --create md-device --chunk=X --level=Y
--raid-devices=Z devices
.......
My interpretation of "--create" is - it creates (!) "md" device , it has to be created for some other function to use it.
But the sentence , to me , reads "udev" creates the "md" device...after it is active...AKA "--create" does not create it.
Logically - how it can be active if it does not have a device yet ?
This is what I have been questioning from get-go - how it ties all together?
Of course the usual answer is - RTFM.
Actually - literal translation of RTFM
" Do not bother me, I do not know the answer ".
Yes, English is not my native language and I often get stuck trying to "translate" some common expression.
Cheers
md-device is the name of the device to create. (mdX)
Z is the count of the raid devices to include. The minimum required number depends on what raid level is being created.
devices are the discrete names of the physical device to include (/dev/sdb /dev/sdc /dev/sdd etc.) Those devices can be an entire physical device, a partition, a HDD, a USB device, etc.
Y is the raid level for the device being created (0, 1, 5, 6, 10, etc.)
--chunk=X only applies if you are creating a device with non-default chunk size.
My interpretation (and experience) is that mdadm creates the array by writing the config on the individual devices and "run"s the array to make it active, then udev recognizes it exists and "creates" the entry in /dev so it can be used the same as any other block device (HDD, SSD, USB device, etc.) mdadm handles the array creation and activation while udev handles making it available for use. Discrete functions that are sequential in nature.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.