[SOLVED] Can't create folder without being root

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

[SOLVED] Can't create folder without being root

Post by JerryF »

Hello all,

I have a Toshiba external 1 TB USB drive that I've partitioned in half using Gparted. File system on the first partition is EXT4 and the other is NTFS.

When I plug in the drive, both partitions mount.

Unfortunately, on the EXT4 partition I can't create folders/files nor can I move/copy to that partition. I can do all this on the NTFS partition.

I've also tried the drive on my desktop computer and the same results occur.

Can anyone enlighten me?

Code: Select all

inxi -Fdxz
System:    Host: HP-EliteBook-8460p Kernel: 4.15.0-38-generic x86_64 bits: 64 gcc: 7.3.0
           Desktop: Xfce 4.12.3 (Gtk 2.24.31) Distro: Linux Mint 19 Tara
Machine:   Device: laptop System: Hewlett-Packard product: HP EliteBook 8460p v: A0001D02 serial: N/A
           Mobo: Hewlett-Packard model: 161C v: KBC Version 97.4E serial: N/A
           BIOS: Hewlett-Packard v: 68SCF Ver. F.65 date: 04/06/2017
Battery    BAT0: charge: 37.9 Wh 87.6% condition: 43.3/43.3 Wh (100%)
           model: Hewlett-Packard Primary status: Charging
CPU:       Dual core Intel Core i5-2520M (-MT-MCP-) arch: Sandy Bridge rev.7 cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9978
           clock speeds: max: 3200 MHz 1: 1045 MHz 2: 1303 MHz 3: 1295 MHz 4: 1469 MHz
Graphics:  Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller bus-ID: 00:02.0
           Display Server: x11 (X.Org 1.19.6 ) drivers: modesetting (unloaded: fbdev,vesa)
           Resolution: 1600x900@59.90hz
           OpenGL: renderer: Mesa DRI Intel Sandybridge Mobile version: 3.3 Mesa 18.0.5 Direct Render: Yes
Audio:     Card Intel 6 Series/C200 Series Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Sound: Advanced Linux Sound Architecture v: k4.15.0-38-generic
Network:   Card-1: Intel 82579LM Gigabit Network Connection driver: e1000e v: 3.2.6-k port: 4060 bus-ID: 00:19.0
           IF: enp0s25 state: down mac: <filter>
           Card-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi bus-ID: 24:00.0
           IF: wlo1 state: up mac: <filter>
Drives:    HDD Total Size: 1570.3GB (29.1% used)
           ID-1: /dev/sda model: Samsung_SSD_860 size: 250.1GB
           ID-2: /dev/sdb model: Hitachi_HTS72323 size: 320.1GB
           ID-3: USB /dev/sdc model: External_USB_3.0 size: 1000.2GB
           Optical: No optical drives detected.
Partition: ID-1: / size: 19G used: 11G (59%) fs: ext4 dev: /dev/sda1
           ID-2: /home size: 191G used: 116G (65%) fs: ext4 dev: /dev/sda3
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 39.0C mobo: 0.0C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 244 Uptime: 19 min Memory: 894.1/7886.6MB Init: systemd runlevel: 5 Gcc sys: 7.3.0
           Client: Shell (bash 4.4.191) inxi: 2.3.56 

Code: Select all

blkid
/dev/sda1: LABEL="Mint19" UUID="03e47a60-65f7-4aae-b040-dc00650f29c0" TYPE="ext4" PARTUUID="d084c6f9-01"
/dev/sda2: LABEL="Mint20" UUID="4a7e21f3-6450-4109-9a09-1107abe5c21f" TYPE="ext4" PARTUUID="d084c6f9-02"
/dev/sda3: LABEL="Home" UUID="b5c92b24-46d0-4918-b4de-eba213a95749" TYPE="ext4" PARTUUID="d084c6f9-03"
/dev/sdb1: LABEL="Timeshift" UUID="1aca5d71-17b7-4263-ad95-71911d2f0893" TYPE="ext4" PARTUUID="d084c6f9-01"
/dev/sdb2: LABEL="Backup" UUID="32659e8d-3ee1-4e81-aea2-05e8a10de14d" TYPE="ext4" PARTUUID="d084c6f9-02"
/dev/sdc1: LABEL="EXT4" UUID="8afa9f22-15f3-4ac0-8734-f6e148f9464d" TYPE="ext4" PARTUUID="695f22ff-01"
/dev/sdc2: LABEL="NTFS" UUID="14F1891E3449B886" TYPE="ntfs" PTTYPE="dos" PARTUUID="695f22ff-02"
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kukamuumuka

Re: Can't create folder without being root

Post by kukamuumuka »

Code: Select all

sudo chmod -R 755  /path/drive
sudo chown -R $USER /path/drive
https://www.computerhope.com/unix/uchown.htm
https://www.computerhope.com/unix/uchmod.htm
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Can't create folder without being root

Post by JerryF »

administrollaattori wrote: Mon Nov 12, 2018 11:02 am

Code: Select all

sudo chmod -R 755  /path/drive
sudo chown -R $USER /path/drive
https://www.computerhope.com/unix/uchown.htm
https://www.computerhope.com/unix/uchmod.htm
Is the /path/drive
/dev/sdc
or where it's mounted
/media/jerry/EXT41
kukamuumuka

Re: Can't create folder without being root

Post by kukamuumuka »

JerryF wrote: Mon Nov 12, 2018 12:23 pm Is the /path/drive
/dev/sdc
or where it's mounted
/media/jerry/EXT41
inxi -po tells.
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Can't create folder without being root

Post by JerryF »

Forgot to thank you for responding administrollaattori---thank you.

This is what I did:

Code: Select all

$ inxi -po
Partition: ID-1: / size: 19G used: 11G (60%) fs: ext4 dev: /dev/sda1
           ID-2: /home size: 191G used: 116G (65%) fs: ext4 dev: /dev/sda3
           ID-3: /media/jerry/Backup size: 263G used: 63G (25%) fs: ext4 dev: /dev/sdb2
           ID-4: /media/jerry/EXT4 size: 458G used: 238G (55%) fs: ext4 dev: /dev/sdc1
           ID-5: /media/jerry/NTFS size: 466G used: 80M (1%) fs: fuseblk dev: /dev/sdc2
Unmounted: ID-1: /dev/sda2 size: 20.48G fs: ext4 label: Mint20 uuid: 4a7e21f3-6450-4109-9a09-1107abe5c21f
           ID-2: /dev/sdb1 size: 32.21G fs: ext4 label: Timeshift uuid: 1aca5d71-17b7-4263-ad95-71911d2f0893
The drive is sdc with EXT4 partition mounted at /media/jerry/EXT4

Code: Select all

sudo chmod -R 755 /media/jerry/EXT4
sudo chown -R $USER /media/jerry/EXT4
After performing these commands, I still cannot create a folder or file in partition EXT4

When I eject the EXT4 partition, unplug the drive, then plug in the drive, the EXT4 partition is mounted as root owner, etc.
Shutter_041.jpg
kukamuumuka

Re: Can't create folder without being root

Post by kukamuumuka »

Code: Select all

sudo chown jerry:jerry -R /media/jerry/EXT4
An another way:

Code: Select all

sudo chown -R $USER:$USER /media/jerry/EXT4
phd21
Level 20
Level 20
Posts: 10104
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Can't create folder without being root

Post by phd21 »

Hi JerryF

+1 for what "administrollaattori" just showed to give permission to your user for that drive's Linux partition

Code: Select all

sudo chown -R $USER:$USER /media/jerry/EXT4
To see drives and their partitions and their mounting points, you can use these commands but the drives and their partitions have to be mounted first. Or, you can use "disks" or a partition manager editor (gparted), etc...

Code: Select all

lsblk -a
or

Code: Select all

lsblk -f
or

Code: Select all

df -h
FYI: If you want the drive and its partitions to always be available and mounted, then see link below.
NTFS Partition does not activate even with automount, until clicking drive in file manager - Linux Mint Forums
viewtopic.php?f=208&t=278971&hilit=disks

..
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Can't create folder without being root

Post by JerryF »

administrollaattori wrote: Mon Nov 12, 2018 2:21 pm

Code: Select all

sudo chown jerry:jerry -R /media/jerry/EXT4
An another way:

Code: Select all

sudo chown -R $USER:$USER /media/jerry/EXT4
Thank you! That worked. It must have been a group ownership problem.

If I may, why does the EXT4 partition mount as root being the owner on my other computer (desktop)?
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Can't create folder without being root

Post by all41 »

JerryF wrote: Mon Nov 12, 2018 3:19 pm
administrollaattori wrote: Mon Nov 12, 2018 2:21 pm

Code: Select all

sudo chown jerry:jerry -R /media/jerry/EXT4
An another way:

Code: Select all

sudo chown -R $USER:$USER /media/jerry/EXT4
Thank you! That worked. It must have been a group ownership problem.

If I may, why does the EXT4 partition mount as root being the owner on my other computer (desktop)?
It's not the partition but the mount point. root owns /media and /media/jerry and therefore owns the partitions mounted there until you reassign ownership to yourself.
Everything in life was difficult before it became easy.
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: [SOLVED] Can't create folder without being root

Post by JerryF »

all41,

Thanks.

So if I make copies of files from my hard disk and put them onto my external USB and then use it on any other computer, I have to be root in order to work with the files?

As of now, when I plug it into the desktop, that's what I get. I have to sudo or be root to copy the files off the drive and onto the desktop hard disk.
Bobb24
Level 3
Level 3
Posts: 118
Joined: Sun Mar 10, 2019 12:12 pm

Re: [SOLVED] Can't create folder without being root

Post by Bobb24 »

I see this is solved but I also want to thank all for this information as it allowed me to take ownership of an internal hard drive that was owned by media / root after new install of Mate 18.3. THANK YOU ! :D
Locked

Return to “Storage”