[SOLVED] Can't create folder without being root

Forum rules
Before you post please read this
Post Reply
User avatar
JerryF
Level 10
Level 10
Posts: 3474
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

[SOLVED] Can't create folder without being root

Post by JerryF » Mon Nov 12, 2018 9:49 am

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 JerryF on Mon Nov 12, 2018 3:24 pm, edited 1 time in total.
IF your problem has been solved, please edit your original post and add [SOLVED] to the beginning of the Subject Line. It helps other members.


User avatar
JerryF
Level 10
Level 10
Posts: 3474
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Can't create folder without being root

Post by JerryF » Mon Nov 12, 2018 12:23 pm

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
IF your problem has been solved, please edit your original post and add [SOLVED] to the beginning of the Subject Line. It helps other members.

User avatar
administrollaattori
Level 15
Level 15
Posts: 5656
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: Can't create folder without being root

Post by administrollaattori » Mon Nov 12, 2018 12:25 pm

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 10
Level 10
Posts: 3474
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Can't create folder without being root

Post by JerryF » Mon Nov 12, 2018 2:06 pm

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
After plugging in the drive
IF your problem has been solved, please edit your original post and add [SOLVED] to the beginning of the Subject Line. It helps other members.

User avatar
administrollaattori
Level 15
Level 15
Posts: 5656
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: Can't create folder without being root

Post by administrollaattori » 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

User avatar
phd21
Level 17
Level 17
Posts: 7512
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Can't create folder without being root

Post by phd21 » Mon Nov 12, 2018 2:47 pm

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 KDE 18.3 & 19, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
JerryF
Level 10
Level 10
Posts: 3474
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Can't create folder without being root

Post by JerryF » 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)?
IF your problem has been solved, please edit your original post and add [SOLVED] to the beginning of the Subject Line. It helps other members.

User avatar
all41
Level 13
Level 13
Posts: 4998
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Can't create folder without being root

Post by all41 » Mon Nov 12, 2018 3:40 pm

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.
Proud to be a supporter and monthly contributor to Mint.

User avatar
JerryF
Level 10
Level 10
Posts: 3474
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

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

Post by JerryF » Mon Nov 12, 2018 3:45 pm

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.
IF your problem has been solved, please edit your original post and add [SOLVED] to the beginning of the Subject Line. It helps other members.

Post Reply

Return to “Mounting Partitions”