"Root" has taken ovnership over internal HDD's?

Halow again everyone.
After upgrading to 24.04 I installed 3 internal Sata HDD's.
They were all used on Ubuntu v. from 16.04. and latter.
I formatted them all in "Disks", through my new upgrade in 24.04.
My problem now is that they are mounted through root at /mnt/ and of course my "Root" partition is 100% full.

How can I get these disks back to my ownership and mounted through /home/media

Regards
Spacepunk

Can you explain in more detail what you mean by this?

My problem now is that they are mounted through root at /mnt/ and of course my "Root" partition is 100% full.

2 Likes

You can edit mount points via Disks. Select the partition in the interface, click the Settings icon :gear:; then select 'Edit Mount Options...'.

In the Settings :gear:, there is also an option to 'Take Ownership'.

2 Likes

Hi Stephen.
I'w done that through Disks.
I was actually working with these options last night.
As soon as I press OK, the mount option changes back to Root/mnt/disk name.
And the option on "Take Ownership", is always faded.

Actually....
Just now I were aloud to change "Ownership" on one of the discs.
Witch is a little varied, there were no sines of that last night.


The two other Discs, still gives me a faded option on " Changing Ownership".

Another thing that has happened during the night Is that on another of the discs the mount place has changed from: " /root/mnt/MITT-SITT"
to: "/media/spacepunk/MITT-SITT".
Witch is what I want.
But through "Properties" on this disk I'm getting:

.
-Then Again, it will probably change after I have rebooted.

Her is also a pic on chancing the "Mount Point" i Disks.
Witch also shows you what I meant with:


I also explained this in top of this replay.

Hear is also a pic from "Disk Usage Analyzer" witch shows my "Root Partition" situation.

I hope this gives you some more clues Stephen and please don't give me up.
And really, THANK YOU for your help.
:smiling_face:
Regards
SpacePunk

2 Likes

The root, /, will always report 100% full.

In the screenshot you provided, it shows just below the menu icons that there is 12.8TB capacity, of which 3.1TB has been used. I think that refers to the (total) for all mounted partitions.

I guess gnome-disks isn't willing to acquire the privileges it needs for you to take ownership. I think the commands you need are summarised here: linux - How can I mount a drive under my home directory at boot? - Unix & Linux Stack Exchange. Wish I could help more, but this is a bit beyond me!

2 Likes

The question of ownership of mount points is thoroughly discussed here https://www.baeldung.com/linux/mount-owner

If one does not insist on writing directly into the root directory of mounted drive (i.e. mount point itself) and is not reluctant to dive into a subdirectory under mount point, then there is simple workaround. One can create a directory within the mount point as root and chown it. User's ownership for that directory will persist across boots.

I use this workaround. That is the whole /home directory is root-owned mountpoint and /home/<me> directrory is owned by me.

5 Likes

Continuing the discussion from ["Root" has taken ovnership over internal HDD's?](https://ubuntu-mate.community/t/root-has-taken-ovnership-over-internal-
hdds/28482/5):

Thanks a lot anyway Stephen, you were the one that got me on to the right track with this.
:thinking: :+1:

And yes I have for now connected a couple more discs, so the drive capacity is quiet high. I'm desperately trying to save and maybe get some old files to work and yes 12.8TB refers to the total amount of mounted partitions.
Then again my "Root" partition only has 500GB.

You say "The root, will always report 100% full" but this means that it is actually full and lacking space ???
This again is my second quest in this and I have some plans with "gParted" and it's Resize/Move option.
But the thing is that "The Full Folders" is in OS system that runs the the hole thing and can not be unmounted. So I thought I could boot the computer up on a live disk and run it from there. This way I can unmount, resize and move it all, couldn't I ????

And I will gladly throw my self in the issue about privileges and ownership of my own payed hardware.........

But keep posted Stephen.
:wave::slightly_smiling_face:

aND also a SOLID TANKS to ugnvs for his very helpfull input.
Cheers Mates :beers:
Regards
SpacePunk

2 Likes

I should not have said 'full'. MATE Disk Usage Analyzer reports the proportion of the total data that is nested within each folder. By definition, / must contain all of the data (i.e. 100%).

2 Likes

Is this the default for most user 'home' folders? My /home/<username> folder is owned by <username>/<username> user/group.

Yes. By default at creation during install, to simplify, the process does not ask for a group name.

Obviously, after confirming the install is stabilized, you can always change the name and id of that "base" user if you so choose, but it needs to be done carefully. I would make sure I had another user with full admin privileges before "tinkering" with finding all locations where the group name and ID need to be changed and updating those all to ensure consistency across the board, while maintaining the original full privileges of that user.

2 Likes

AFAIK, root owns mountpoint (i.e. root directory of the mounted drive) by default. I am not certain about user's home directory because I set up it manually. Currently

:/home$ ls -l
drwx------  2 ugnvs root 16384 2016-08-08 10:46:31 lost+found
drwxr-xr-x 54 ugnvs ugnvs   4096 2024-11-14 10:46:49 ugnvs
1 Like

On old HP-UX, and possibly with Linux (unsure), you had to create the mountpoint with root ownership and privileges 755 to ensure mounting a device to that folder (with user-specific ownership/group/privileges) would behave properly. I remember distinctly that weird things happened if that was not the case, but I can't remember what, because it was so long ago.

1 Like

SORRY GUYS!
I really am to slow to get back to you about this "Issue" of mine.
On the other hand I'm deleing with medical issues and....
Well......
:sleeping:
I'm NOT sorry ACTUALLY.

This communion is suppose to support both TERMINAL and GRAPHICAL user's !

I didn't say anything about this, but "I am a Graphical User" and hear come's the sorry part (I guess...). I don't sit in front of my screens more than 2 to.... :roll_eyes: and I just didn't get around to learn the actual understanding of using Linux :shushing_face:.

And just to confirm my use of "This Community".
I also do the work of spending the amount of time browsing to find an answer before I release a topic hear.

I have done the "graphical" options you have shown me.
Still "Root" is is calming it's ownership and now it's actually becoming a problem for me.
As an example I now encounter that; "I'm refused to open file's in the different software's delivered with Ubuntu-Mate.

So back to the quest.
I'm still encountering that "Root" has taken "Ownership" of my internal and external HD's.......
I'm keept away from claiming my ownership of all my HDD's..... and it F..... feels like "Root" is working against me.

Can any one, please just give me the "TERMINAL COMMANDS" that I need to store my own ownership of my own disck's ???

Regards to all of YOU.
:slightly_smiling_face:SpacePunk.

1 Like

Things have obviously gotten very confusing, if even the more experienced members are having trouble identifying the breakdown and what to fix. So ...

Let's go back to some basic steps and work from the ground up.

First, let's pinpoint the device and get its name, if it has one. That way, we will know we are dealing with the correct device.


Requirement #1

We need the fullpath to the mountpoint, i.e.

  • /mountDir
    (normal form for non-root partitions on same device as root), or

  • /site/mountDir
    (my preferred for non-root devices/partitions), or

  • /media/userid/mountDir
    (system-preferred for plug-n-play auto-mount devices/partitions)

/mnt is NOT the location for a user-defined/-named mountpoint directory. That is used strictly for system internal action.


Requirement #2

Provide report from

ls -l /dev/${deviceFile}

Requirement #3

As part of getting that clarity on the situation at hand, let's get a list of ALL your devices and what is know for each of them.

Can you please provide the output of the following script?

Please provide the output from the command

Devices__ReportDiskParts.sh --raw

for the following script:

#!/bin/sh

###
###	$Id: Devices__ReportDiskParts.sh,v 1.7 2021/02/20 02:43:37 root Exp root $
###
###	Script to report all partitions that detected by the system.
###


TMP=/tmp/`basename $0 ".sh" `.tmp

doFSTAB=0
while [ $# -gt 0 ]
do
	case $1 in
		"--fstab" )	doFSTAB=1 ; break ;;
		"--disk" )	lsblk -l -p --output-all | awk  '/[/]dev[/]sd[a-z][0-9]/ { print $0 }' | sort --key=3 | awk '{ printf("%s\n\n", $0 ) ; }' ; exit 0 ;;
		"--pairs" )	lsblk -p -P --output-all | awk  '/[/]dev[/]sd[a-z][0-9]/ { print $0 }' | sort --key=3 | awk '{ printf("%s\n\n", $0 ) ; }' ; exit 0 ;;
		"--raw" )	lsblk -l -p --output-all | sort --key=3 | awk '{ printf("%s\n\n", $0 ) ; }' ; exit 0 ;;
		* )  echo "\n\t Invalid parameter '$1' used on command line.  Only options allowed:  [ --raw | --disk | --fstab ]\n Bye!\n" ; exit 1 ;;
	esac
done

if [ -z "${MROOT}" ]
then
	MROOT="/site" ; export MROOT
fi

pROOT=`df / | grep '/dev/' | awk '{ print $1 }' `
dROOT=`echo ${pROOT} | cut -c1-8 `

# If not terminal redirect comments to stderr.
if [   -t 1 ] ; then echo "\n\t NOTE:  Expected mount point parent for all partitions not on root device => '$MROOT' ..."   ; fi
#if [ ! -t 1 ] ; then echo "\n\t NOTE:  Expected mount point parent for all partitions not on root device => '$MROOT' ..." >&2 ; fi

###
###	All available parameters for lsblk	(based on lsblk from util-linux 2.31.1)
###
###	In sort order reported by --output-all
###
#1	 NAME
#	 KNAME
#	 MAJ:MIN
#2	 FSTYPE
#5	 MOUNTPOINT
#ALT3	 LABEL
#4	 UUID
#	 PARTTYPE
#3	 PARTLABEL
#	 PARTUUID
#	 PARTFLAGS
#	 RA
#	 RO
#	 RM
#	 HOTPLUG
#	 MODEL
#	 SERIAL
#6	 SIZE
#	 STATE
#	 OWNER
#	 GROUP
#	 MODE
#	 ALIGNMENT
#	 MIN-IO
#	 OPT-IO
#	 PHY-SEC
#	 LOG-SEC
#	 ROTA
#	 SCHED
#	 RQ-SIZE
#	 TYPE
#	 DISC-ALN
#	 DISC-GRAN
#	 DISC-MAX
#	 DISC-ZERO
#	 WSAME
#	 WWN
#	 RAND
#	 PKNAME
#	 HCTL
#	 TRAN
#7	 SUBSYSTEMS
#	 REV
#	 VENDOR
#	 ZONED


#lsblk -l -p -o NAME,FSTYPE,PARTLABEL,UUID,SIZE,MOUNTPOINT,SUBSYSTEMS | grep -v 'GRUB' | awk  '/[/]dev[/]sd[a-z][0-9]/ { print $0 }' | sort --key=3 > ${TMP}.lsblk
#cat ${TMP}.lsblk
#cat ${TMP}.lsblk | awk '{ print NF }'

lsblk -P -p -o NAME,FSTYPE,PARTLABEL,UUID,SIZE,MOUNTPOINT,SUBSYSTEMS | grep -v 'GRUB' | awk  '/[/]dev[/]sd[a-z][0-9]/ { print $0 }' | sort --key=3 > ${TMP}.lsblk.PAIRS

#cat ${TMP}.lsblk.PAIRS
while read line
do
	eval echo '${line}' | tr ' ' "\n" |
	{	fTYPE=""
		while read data
		do
			eval echo '${data}' | awk -F'"' -v ftype="${fTYPE}" '{
				split($1, vars, "=" ) ;
				Fname=vars[1] ;
#				Fval=vars[2] ;	
				Fval=$2 ;	
				if( Fval == "" ){
					Fval="null" ;
				} ;
				printf("%s ", Fval) ;
#				printf("%s|%s ", Fname, Fval) ;
			}'
#			case ${data} in
#				FSTYPE* ) fTYPE="USB" ;;
#				* ) ;;
#			esac
		done
	}
	echo ""
done <${TMP}.lsblk.PAIRS >${TMP}.lsblk
#cat ${TMP}.lsblk
#cat ${TMP}.lsblk | awk '{ print NF }'


## WD 4 TB My Book
#----------------------------------------------------------------------------------------------------------------------
#/dev/sdb1 on /site/My Book type exfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,namecase=0,errors=remount-ro,uhelper=udisks2)
###	1,4,9,7,5,18
#----------------------------------------------------------------------------------------------------------------------
###	/dev/sdb1    exfat    My         Book                                   Not_Mounted   /My
#/dev/sdb1  /dev/sdb1  /dev/sdb1    8:17     3.7T   3.7T exfat        6M     0% /site/My Book     My Book  40FA-E56B                            fc843c51-1aec-4aab-8676-9043c9e59d0d atari  ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 My Book   4c1ee663-135c-4809-a61e-f38ec52d80a7           128  0  0       1                                                  3.7T         root  disk  brw-rw----         0   4096      0    4096     512    1 mq-deadline       2 part        0        4K       4G         0    0B                       1 /dev/sdb                   block:scsi:usb:pci               none
#----------------------------------------------------------------------------------------------------------------------
###	/dev/sde3    ext4     DB002_F1   1b4157be-79cd-472b-96d9-a4cabacaffe1   Not_Mounted   /site/DB002_F1
#/dev/sde3  /dev/sde3  /dev/sde3    8:67                 ext4                                                 DB002_F1 1b4157be-79cd-472b-96d9-a4cabacaffe1 9a3649a5-cbbb-4f1b-ae0b-f3c0d9cdec21 dos    c12a7328-f81f-11d2-ba4b-00a0c93ec93b DB002_F1  a9b2eda8-ec21-4999-b1f6-eab36ce3bf75           128  0  0       0                                                279.4G         root  disk  brw-rw----         0   4096      0    4096     512    1 mq-deadline      64 part        0        0B       0B         0    0B 0x50014ee263b2c636    1 /dev/sde                   block:scsi:pci                   none
#----------------------------------------------------------------------------------------------------------------------


#----------------------------------------------------------------------------------------------------------------------
###	**** ERROR ****  Not handling 'My Passport' condition correctly
###
###	Reporting as follows:
###	/dev/sde1    ntfs     My         null                                   Mounted       1.8T                           /media/ericthered/My
#----------------------------------------------------------------------------------------------------------------------

if [ ${doFSTAB} -eq 0 ]
then
	if [   -t 1 ] ; then echo "\n\t ALL recognized DISK partitions:\n"     ; fi
	#if [ ! -t 1 ] ; then echo "\n\t ALL recognized DISK partitions:\n" >&2 ; fi

	cat ${TMP}.lsblk | awk -v othrPath=${MROOT} -v dROOT="${dROOT}" '{
		if ( $6 == "null" ){
			if ( $2 == "swap" ){
			       	printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Not_Enabled", "[SWAP_OFFLINE]", $7 ) ;  
			}else{
				if ( index($1,dROOT) == 0 ){
					thatPath=sprintf("%s/%s", othrPath, $3 ) ;
					printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Not_Mounted", thatPath, $7 ) ; 
				}else{
					thatPath=sprintf("/%s", $3 ) ;
					printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Not_Mounted", thatPath, $7 ) ; 
				} ;
			} ;
		}else{
	     		if ( $2 == "swap" ){
				printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Enabled", $6, $7 ) ;
			}else{
				printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Mounted", $6, $7 ) ;
			} ;
		} ;
	}'
else
	if [   -t 1 ] ; then echo "\n\t ALL recognized DISK partitions reported in format required to update '/etc/fstab':\n"     ; fi
	#if [ ! -t 1 ] ; then echo "\n\t ALL recognized DISK partitions reported in format required to update '/etc/fstab':\n" >&2 ; fi

	#/dev/sdd1    ext4     DB002_F1   0aa50783-954b-4024-99c0-77a2a54a05c2   300G          /site/DB002_F1
	#UUID=f56b6086-229d-4c17-8a5b-e68de1a4e73d	/	ext4	errors=remount-ro	0	1
	#UUID=7e9a663e-ff1d-4730-8544-c37519056b6f	/DB001_F2	ext4	nosuid,nodev,nofail,errors=remount-ro	0	2 
	#UUID=c37e53cd-5882-401c-8ba3-172531a082e9	none	swap	sw,pri=3	0	0

	###
	###	FUTURES:   USB options  rw,suid,umask=0000,uid=1000,gid=1000
	###
	cat ${TMP}.lsblk | awk -v othrPath=${MROOT} -v pROOT="${pROOT}" -v dROOT="${dROOT}" '{
	     if( index( $0, "usb" ) != 0 ){
			usbPlug="USB_EXTERNAL" ;
	     }else{
			usbPlug="INTERNAL" ;
	     } ;

		if ( $6 == "null" ){
			if ( $2 == "swap" ){
				if ( $1 == pROOT ) {
					perms="sw,pri=1" ;
					seq=1 ;
				}else{
					perms="sw,pri=2" ;
					seq=2 ;
				} ;
				if( $4 == "null" ){
					printf("### %s ###  No value for UUID. No file system on this partition.\n\n", $3 ) ;
				}else{
					printf("# %-12s %-8s %-10s %-38s %-13s %s %s\n", $1, $2, $3, $4, $5, "[SWAP]", usbPlug ) ;  
					printf("UUID=%s \t%s \t%s \t%s \t%s \t%s\n\n", $4, "none", $2, perms, "0", seq ) ;
				} ;
			}else{
				if ( $1 == pROOT ) {
					perms="defaults" ;
					seq=0 ;
				}else{
					#perms="nosuid,nodev,nofail,defaults" ;
					if( usbPlug == "USB_EXTERNAL" ){
						perms="defaults,nofail,noauto" ;
					}else{
						perms="defaults,nofail" ;
					} ;
					if ( $1 ~ dROOT ) { seq=1 ; }else{ seq=2 ; } ;
				} ;
				if( $4 == "null" ){
					printf("### %s ###  No value for UUID. No file system on this partition.\n\n", $3 ) ;
				}else{
					if ( index($1,dROOT) == 0 ){
						printf("# %-12s %-8s %-10s %-38s %-13s %s/%s %s\n", $1, $2, $3, $4, $5, othrPath, $3, usbPlug ) ; 
						printf("UUID=%s \t%s/%s \t%s \t%s \t%s \t%s\n\n", $4, othrPath, $3, $2, perms, "0", seq ) ;
					}else{
						printf("# %-12s %-8s %-10s %-38s %-13s /%s %s\n", $1, $2, $3, $4, $5, $3, usbPlug ) ; 
						printf("UUID=%s \t/%s \t%s \t%s \t%s \t%s\n\n", $4, $3, $2, perms, "0", seq ) ;
					} ;
				} ;
			} ;
		}else{
	     		if ( $2 == "swap" ){

				if ( $1 == pROOT ) {
					perms="sw,pri=1" ;
					seq=1 ;
				}else{
					perms="sw,pri=2" ;
					seq=2 ;
				} ;
				if( $4 == "null" ){
					printf("### %s ###  No value for UUID. No file system on this partition.\n\n", $3 ) ;
				}else{
					printf("# %-12s %-8s %-10s %-38s %-13s %s %s\n", $1, $2, $3, $4, $5, $6, usbPlug ) ;
					printf("UUID=%s \t%s \t%s \t%s \t%s \t%s\n\n", $4, "none", $2, perms, "0", seq ) ;
				};
			}else{

				if ( $1 == pROOT ) {
					perms="defaults" ;
					seq=0 ;
				}else{
					#perms="nosuid,nodev,nofail,defaults" ;
					if( usbPlug == "USB_EXTERNAL" ){
						perms="defaults,nofail,noauto" ;
					}else{
						perms="defaults,nofail" ;
					} ;
					if ( $1 ~ dROOT ) { seq=1 ; }else{ seq=2 ; } ;
				} ;
				if( $4 == "null" ){
					printf("### %s ###  No value for UUID. No file system on this partition.\n\n", $3 ) ;
				}else{
					printf("# %-12s %-8s %-10s %-38s %-13s %s %s\n", $1, $2, $3, $4, $5, $6, usbPlug ) ;
					printf("UUID=%s \t%s \t%s \t%s \t%s \t%s\n\n", $4, $6, $2, perms, "0", seq ) ;
				};
			} ;
		} ;
	}'
fi

# Other command format for other properties related to partitions:
#	lsblk -o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,RA,WSAME

# Other option which is not as complete:
#	blkid -o list

if [   -t 1 ] ; then echo "\n\t Done.  [`basename $0 `]\n"     ; fi
#if [ ! -t 1 ] ; then echo "\t Done.  [`basename $0 `]\n" >&2 ; fi

rm -f ${TMP}.*

exit 0
exit 0
exit 0

If you prefer, limit the sharing of the output to only the line relevant to the device in question.


Recommendation

If the offending partitions do not have a Partition Label, please consider giving those partitions a unique label. VERY IMPORTANT: as always, ensure you have full backup of that data before attempting to assign that label via "gparted". The partition must be un-mounted in order to give it a label.

1 Like

Installation default is 755 with user/group being root/root.

Thanks Eric :slightly_smiling_face:
I will pick this up and you'll hear from me.