LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-03-2020, 06:26 PM   #1
jan128
Member
 
Registered: Nov 2020
Posts: 201

Rep: Reputation: Disabled
Implementing "mount" and associated tools


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.
 
Old 11-03-2020, 11:27 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
GUIs can sometimes be ... unclear...

Let's try from the cmd line. What do
Code:
lsblk

mount

df -h
show ?

PS which distro & version ?

Last edited by chrism01; 11-03-2020 at 11:29 PM.
 
Old 11-04-2020, 09:23 AM   #3
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
GUIs can sometimes be ... unclear...

Let's try from the cmd line. What do
Code:
lsblk

mount

df -h
show ?

PS which distro & version ?

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.

Code:
f@f-SATA:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           769M  9.9M  759M   2% /run
/dev/sdc8       104G   64G   35G  65% /
tmpfs           3.8G   78M  3.7G   3% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/sdc1       511M  3.7M  508M   1% /boot/efi
/dev/sdc9       115G   60M  110G   1% /mnt/d8589477-2356-40f4-a7f1-e564aaa4af22
tmpfs           769M   52K  769M   1% /run/user/1000
/dev/sdk6       1.6G  2.5M  1.5G   1% /media/f/MD42_TEST_LABEL
/dev/sdf3       9.1G   21M  8.6G   1% /media/f/ISO
/dev/sdf18      5.7G  5.6G     0 100% /media/f/6a707b8c-f7f4-4c89-b737-a99edf1d595a
/dev/sdf9        96G  1.8G   90G   2% /media/f/WorkspaceRaspber
/dev/sdf23       96G  173M   91G   1% /media/f/NEW_RAID_MD5
/dev/sdf16      3.8G  7.9M  3.6G   1% /media/f/bdab9244-d5f1-4d5d-8ee6-c0e891a5ceb7
/dev/sdf11      6.1G  1.1G  4.7G  19% /media/f/Alternate downlo
/dev/sdf15      193G  3.4G  179G   2% /media/f/QT
/dev/sdf10       38G   35G  1.3G  97% /media/f/Eclipse
/dev/sdf6        62G  6.6G   56G  11% /media/f/OpenCameraB
/dev/sde8        29M  371K   26M   2% /media/f/BOOT
/dev/sde23       56G   52M   53G   1% /media/f/568e5906-f465-44b6-8a05-61711882e84a
/dev/sde6        44G   52M   42G   1% /media/f/64ff8813-f1b8-45ce-9d26-5c0162276335
/dev/sdf8       106G  161M  105G   1% /media/f/0822C8912019FFC8
/dev/sde28       48G   52M   46G   1% /media/f/b7216aa3-0074-4f56-aa73-b7a104540dbe
/dev/sde26      2.9G  4.5M  2.7G   1% /media/f/MD_42_5_Label
/dev/sdf5        40G   39G  253M 100% /media/f/Programs
/dev/sde27      2.9G  4.5M  2.7G   1% /media/f/MD_42_5_Label1
/dev/sde2        66G   55G  7.5G  89% /media/f/36b009b5-8af9-4d2a-b1ff-fda9432bb4c6
/dev/sde12       25G  3.9G   21G  16% /media/f/REsume
/dev/sdf7        98G   51G   48G  52% /media/f/Ex Drive Co
/dev/sde10      415G  202G  214G  49% /media/f/Photo Album1
/dev/sdf1       415G  202G  214G  49% /media/f/Photo Album
f@f-SATA:~$
Appreciate your help very much.
Cheers

Last edited by jan128; 11-04-2020 at 09:30 AM.
 
Old 11-04-2020, 09:57 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
In your previous thread it was mentioned you can manually edit your /etc/fstab file and add filesystems with mount points of your choice.

Code:
UUID=d8589477-2356-40f4-a7f1-e564aaa4af22 /mnt/my_mount_point ext4 defaults 0 0
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.
 
Old 11-04-2020, 11:42 AM   #5
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
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.


Code:
/dev/sdk2       6.3G   15M  6.0G   1% /media/f/d758e541-76d6-45c1-b604-a753a0f73825
/dev/sdk1       8.2G  7.1G  711M  92% /media/f/EclipseBackup
It sure looks as ONLY USB "removable" drives are automatically mounted - which conform to your statement.

Only SATA drive mounted is a result of ISO installation - which is still intact in "fstab".

Since I am using app "Files" - on desktop - my next step would be to make sure I can identify mount point by name in "Files".

Cheers
 
Old 11-04-2020, 01:35 PM   #6
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
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.
 
Old 11-04-2020, 01:42 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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.
 
Old 11-06-2020, 07:54 PM   #8
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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
 
Old 11-06-2020, 08:29 PM   #9
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
"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.

Windows does it similarly.

HTH
 
Old 11-07-2020, 09:26 AM   #10
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
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.

Cheers
 
Old 11-07-2020, 10:10 AM   #11
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
Thanks for the post, much appreciated.

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.
 
Old 11-07-2020, 11:25 AM   #12
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
Usage: mdadm --create md-device --chunk=X --level=Y
--raid-devices=Z devices

...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.

Cheers
 
Old 11-07-2020, 06:42 PM   #13
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
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.
 
  


Reply

Tags
disks, mount



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
Help With Java Problem Please"""""""""""" suemcholan Linux - Newbie 1 04-02-2008 06:02 PM
Installed Mandrake 10.1 - ""There is no action associated with..." neuropulse Linux - Newbie 3 04-25-2005 02:59 AM
"This system may not be updated until it is associated with a channel" up2date sammigrrl Fedora 7 04-18-2005 09:27 PM
"no action associated with filetype" guy24x Mandriva 1 03-02-2005 06:48 PM
no action associated with "Floppy" TravisB Linux - General 1 02-05-2004 11:04 PM

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

All times are GMT -5. The time now is 09:29 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