0

I am running Linux Ubuntu 20.04 and for some reason unknown to me, one of my storage drives suddenly has changed ownership to root and all file permisions are read/write/execute for all users. A peculiar thing is that I can still write to the drive and its folders without being root.

Running uname -a and lsblk gives the following output. The problematic drive is DATA1.

(base) nano2@nano2:/mnt$ uname -a Linux nano2 5.15.0-73-generic #80~20.04.1-Ubuntu SMP Wed May 17 14:58:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux (base) nano2@nano2:/mnt$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 73.9M 1 loop /snap/core22/766 loop1 7:1 0 73.9M 1 loop /snap/core22/750 loop2 7:2 0 349.7M 1 loop /snap/gnome-3-38-2004/140 loop4 7:4 0 460.7M 1 loop /snap/gnome-42-2204/105 loop5 7:5 0 349.7M 1 loop /snap/gnome-3-38-2004/137 loop6 7:6 0 53.3M 1 loop /snap/snapd/19457 loop7 7:7 0 4K 1 loop /snap/bare/5 loop8 7:8 0 63.5M 1 loop /snap/core20/1891 loop9 7:9 0 81.3M 1 loop /snap/gtk-common-themes/1534 loop10 7:10 0 63.5M 1 loop /snap/core20/1950 loop11 7:11 0 46M 1 loop /snap/snap-store/638 loop12 7:12 0 12.3M 1 loop /snap/snap-store/959 loop13 7:13 0 91.7M 1 loop /snap/gtk-common-themes/1535 loop14 7:14 0 53.3M 1 loop /snap/snapd/19361 loop15 7:15 0 466.6M 1 loop /snap/gnome-42-2204/111 sda 8:0 0 7.3T 0 disk /mnt/DATA2 sdb 8:16 0 3.7T 0 disk └─sdb1 8:17 0 3.7T 0 part /mnt/DATA1 nvme0n1 259:0 0 7.3T 0 disk ├─nvme0n1p1 259:1 0 512M 0 part /boot/efi └─nvme0n1p2 259:2 0 7.3T 0 part / 

In /mnt my data drives list:

(base) nano2@nano2:/mnt$ ll total 16 drwxr-xr-x 4 root root 4096 May 10 2022 ./ drwxr-xr-x 20 root root 4096 Mar 20 12:18 ../ drwxrwxrwx 1 root root 4096 Jul 4 11:30 DATA1/ drwx------ 5 nano2 nano2 4096 Apr 3 10:35 DATA2/ 

Trying to run chown does not raise any error messages, but does not seem to do anyting either:

(base) nano2@nano2:/mnt$ sudo chown -R nano2:nano2 DATA1/ [sudo] password for nano2: (base) nano2@nano2:/mnt$ ll total 16 drwxr-xr-x 4 root root 4096 May 10 2022 ./ drwxr-xr-x 20 root root 4096 Mar 20 12:18 ../ drwxrwxrwx 1 root root 4096 Jul 4 11:30 DATA1/ drwx------ 5 nano2 nano2 4096 Apr 3 10:35 DATA2/ 

All files, existing and new get read, write and execute permissions for all users, and I cannot seem to change this with chmod:

(base) nano2@nano2:/mnt/DATA1$ mkdir test (base) nano2@nano2:/mnt/DATA1$ cd test/ (base) nano2@nano2:/mnt/DATA1/test$ touch my_test.file (base) nano2@nano2:/mnt/DATA1/test$ ll total 4 drwxrwxrwx 1 root root 160 Jul 4 15:11 ./ drwxrwxrwx 1 root root 4096 Jul 4 15:11 ../ -rwxrwxrwx 1 root root 0 Jul 4 15:11 my_test.file* (base) nano2@nano2:/mnt/DATA1/test$ sudo chmod 666 my_test.file (base) nano2@nano2:/mnt/DATA1/test$ ll total 4 drwxrwxrwx 1 root root 160 Jul 4 15:11 ./ drwxrwxrwx 1 root root 4096 Jul 4 15:11 ../ -rwxrwxrwx 1 root root 0 Jul 4 15:11 my_test.file* 

Any advice is much appreciated!

3
  • 2
    mount | grep DATA please. In your question. Commented Jul 18, 2023 at 11:12
  • "A peculiar thing is that I can still write to the drive and its folders without being root." - this is to be expected as 777 grants RWX to owner, group, and all others. Commented Jul 18, 2023 at 11:27
  • What format are your data partitions. Windows formats like NTFS or FAT32 do not support Linux ownership & permissions. They are set for entire partition with the mount, either in fstab or when manually mounting. Post in question: lsblk -f Commented Jul 18, 2023 at 15:29

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.