Unable to delete files

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Tgatim
Level 1
Level 1
Posts: 14
Joined: Thu May 07, 2020 1:02 pm

Unable to delete files

Post by Tgatim »

I am New to Linux. I have installed XFCE 20.0 on my computer successfully. I have kept the old windows drive in the computer as backup for some old files. I want to delete or move some of those old files but they show a padlock on file manager and delete is not available. How do I change this?
RIH
Level 6
Level 6
Posts: 1154
Joined: Sat Aug 22, 2015 3:47 am

Re: Unable to delete files

Post by RIH »

Best guess with what you have given....
You need to re-open that drive in a version of Windows 10 that has had fast startup disabled...
https://www.computerhope.com/issues/ch001762.htm
Shut down Windows, start up Mint & the disk will now behave itself...
Tgatim
Level 1
Level 1
Posts: 14
Joined: Thu May 07, 2020 1:02 pm

Re: Unable to delete files

Post by Tgatim »

I don,t Have windows any-more. I just kept the old drive for the files on it.
I have copied most of the files over to my new main drive but would now like to keep some of the original as backup.
there are some other files on the old drive, windows programs etc, I would like to delete to make space for new data.
I don't understand what the padlock symbol means.
If I look at file properties they all say read and write but in file manager I cannot move or delete anything.
RIH
Level 6
Level 6
Posts: 1154
Joined: Sat Aug 22, 2015 3:47 am

Re: Unable to delete files

Post by RIH »

Best guess gone then :D ... so you need to read
help.png
& supply some system information...
User avatar
GS3
Level 8
Level 8
Posts: 2385
Joined: Fri Jan 06, 2017 7:51 am

Re: Unable to delete files

Post by GS3 »

Tgatim wrote:
Sat May 08, 2021 6:54 am
I don,t Have windows any-more. I just kept the old drive for the files on it.
I have copied most of the files over to my new main drive but would now like to keep some of the original as backup.
there are some other files on the old drive, windows programs etc, I would like to delete to make space for new data.
I don't understand what the padlock symbol means.
If I look at file properties they all say read and write but in file manager I cannot move or delete anything.
Padlock means "locked". Took me years to find out.

Format the drive and be done with it.
Please do not use animated GIFs in avatars because many of us find them distracting and obnoxious. Thank you.
Tgatim
Level 1
Level 1
Posts: 14
Joined: Thu May 07, 2020 1:02 pm

Re: Unable to delete files

Post by Tgatim »

sarcasm doesn't help. I understand it means locked but what has locked it and why is it locked.
I would like to know how to UN-lock it.
If you don't have an answer then just say so.
User avatar
spamegg
Level 6
Level 6
Posts: 1186
Joined: Mon Oct 28, 2019 2:34 am

Re: Unable to delete files

Post by spamegg »

Tgatim it looks like this is a permissions issue on that old Windows drive. Can you provide the output of the following terminal commands:

Code: Select all

lsblk

Code: Select all

blkid

Code: Select all

cat /etc/fstab

Code: Select all

inxi -Fxpmrz
Click </> from the mini toolbar above the textbox where you type your reply
and then place your cursor between the code markers and paste the results of the
command between the code markers like this: [code]Results[/code].
User avatar
GS3
Level 8
Level 8
Posts: 2385
Joined: Fri Jan 06, 2017 7:51 am

Re: Unable to delete files

Post by GS3 »

Tgatim wrote:
Sat May 08, 2021 7:36 am
sarcasm doesn't help. I understand it means locked but what has locked it and why is it locked.
I would like to know how to UN-lock it.
If you don't have an answer then just say so.
Well, you did say "I don't understand what the padlock symbol means."

The answer seems to be that Windows left the drive Locked. You can start up Windows to unlock it from there and then properly shut down the computer or you can format the drive or you can look here viewtopic.php?f=90&t=348614

The issue of "Linux problems" which are caused by not properly shutting down Windows comes up very frequently.
viewtopic.php?f=90&t=344852&start=40
Please do not use animated GIFs in avatars because many of us find them distracting and obnoxious. Thank you.
rene
Level 17
Level 17
Posts: 7543
Joined: Sun Mar 27, 2016 6:58 pm

Re: Unable to delete files

Post by rene »

To immediately add onto spamegg's reply, deleting/moving "as root" rather than as your user will be the easiest solution in that (expected) case. You can also mount the drive while giving your own user account enough permission but for quick solution, sudo from the command line or rclicking an empty part of the folder in a graphical filemanager and selecting "Open as root" or alike will likely be all you need.
RIH
Level 6
Level 6
Posts: 1154
Joined: Sat Aug 22, 2015 3:47 am

Re: Unable to delete files

Post by RIH »

I thought that drives formatted for Windows only had 'ghost' permissions under Linux - i.e. 'root' or 'user' made very little difference.
However, until the OP gives some system information I think all is a guess, which might be a better way forward for him rather than nit picking at replies...
rene
Level 17
Level 17
Posts: 7543
Joined: Sun Mar 27, 2016 6:58 pm

Re: Unable to delete files

Post by rene »

Well, they do have 'ghost permissions' only as you put it, stemming from the fact that neither NTFS nor FAT support per-file/directory UNIX-permission metadata (in the case of NTFS, "at a basic level") whereas due to the fundamental nature of said metadata for UNIX systems Linux still has to make something up. By default ownership of all files/directories on a mounted NTFS/FAT filesystem is as such set to the user that mounts the filesystem; in the case of having "kept the old Windows drive in the computer" therefore normally the "root" user, furthermore denying lesser mortals such as his own user ability to e.g. delete.

On a permanent basis you can adjust this by adding e.g. uid=tgatim,gid=tgatim to the mount options in fstab (if "tgatim" is the UNIX username, of course) but as said, working on that drive simply as root may be more practical. Don't in any case think we're going to need a few pages of diagnosis first here :)
Tgatim
Level 1
Level 1
Posts: 14
Joined: Thu May 07, 2020 1:02 pm

Re: Unable to delete files

Post by Tgatim »

[/c]
spamegg wrote:
Sat May 08, 2021 7:44 am
Tgatim it looks like this is a permissions issue on that old Windows drive. Can you provide the output of the following terminal commands:

Code: Select all

lsblk

Code: Select all

blkid

Code: Select all

cat /etc/fstab

Code: Select all

inxi -Fxpmrz
Click </> from the mini toolbar above the textbox where you type your reply
and then place your cursor between the code markers and paste the results of the
command between the code markers like this: [code]Results[/code].
[code]lynntim@lynntim-DH61CR:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 465.3G 0 part /run/timeshift/backup
sdb 8:16 0 298.1G 0 disk
├─sdb1 8:17 0 47.1M 0 part
├─sdb2 8:18 0 204M 0 part /media/lynntim/System
├─sdb3 8:19 0 9.8G 0 part
└─sdb4 8:20 0 288.1G 0 part /media/lynntim/OS-Install
sdf 8:80 1 1.9G 0 disk
└─sdf1 8:81 1 1.9G 0 part /media/lynntim/688A-CD4E
sr0 11:0 1 1024M 0 rom
lynntim@lynntim-DH61CR:~$ blkid
/dev/sda1: UUID="0588-DAAD" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="aed30849-4390-4f6e-92c3-b75c31e3ab78"
/dev/sda2: UUID="c33d756f-b460-46e9-b32e-036faa65faea" TYPE="ext4" PARTUUID="71da6451-db3d-4cb0-a9f9-9623c72aa933"
/dev/sdb1: SEC_TYPE="msdos" LABEL="DIAGNOSTICS" UUID="181D-5EC4" TYPE="vfat" PARTUUID="eb6110cd-01"
/dev/sdb2: LABEL="System" UUID="9A9A1FC99A1FA135" TYPE="ntfs" PARTUUID="eb6110cd-02"
/dev/sdb3: LABEL="WinRE" UUID="CCC420D2C420C116" TYPE="ntfs" PARTUUID="eb6110cd-03"
/dev/sdb4: LABEL="OS-Install" UUID="1AEA2442EA241C8F" TYPE="ntfs" PARTUUID="eb6110cd-04"
/dev/sdf1: SEC_TYPE="msdos" UUID="688A-CD4E" TYPE="vfat"
lynntim@lynntim-DH61CR:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=c33d756f-b460-46e9-b32e-036faa65faea / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=0588-DAAD /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
lynntim@lynntim-DH61CR:~$ inxi -Fxpmrz
System:
Kernel: 5.4.0-72-generic x86_64 bits: 64 compiler: gcc v: 9.3.0
Desktop: Xfce 4.14.2 Distro: Linux Mint 20.1 Ulyssa
base: Ubuntu 20.04 focal
Machine:
Type: Desktop System: OEGStone product: DH61CR v: N/A serial: <filter>
Mobo: Intel model: DH61CR v: AAG14064-207 serial: <filter> UEFI: Intel
v: BEH6110H.86A.0044.2012.0531.1710 date: 05/31/2012
Memory:
RAM: total: 3.75 GiB used: 1.11 GiB (29.7%)
RAM Report:
permissions: Unable to run dmidecode. Root privileges required.
CPU:
Topology: Dual Core model: Intel Core i3-2120 bits: 64 type: MT MCP
arch: Sandy Bridge rev: 7 L2 cache: 3072 KiB
flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 26339
Speed: 1596 MHz min/max: 1600/3300 MHz Core speeds (MHz): 1: 1597 2: 1596
3: 1596 4: 1596
Graphics:
Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
driver: i915 v: kernel bus ID: 00:02.0
Display: x11 server: X.Org 1.20.9 driver: modesetting unloaded: fbdev,vesa
resolution: 1440x900~60Hz
OpenGL: renderer: Mesa DRI Intel HD Graphics 2000 (SNB GT1)
v: 3.3 Mesa 20.2.6 direct render: Yes
Audio:
Device-1: Intel 6 Series/C200 Series Family High Definition Audio
driver: snd_hda_intel v: kernel bus ID: 00:1b.0
Device-2: Generalplus 808 Camera type: USB driver: snd-usb-audio,uvcvideo
bus ID: 1-1.4:6
Sound Server: ALSA v: k5.4.0-72-generic
Network:
Device-1: Intel 82579V Gigabit Network driver: e1000e v: 3.2.6-k
port: f080 bus ID: 00:19.0
IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
Local Storage: total: 765.72 GiB used: 454.99 GiB (59.4%)
ID-1: /dev/sda vendor: Seagate model: ST3500312CS size: 465.76 GiB
ID-2: /dev/sdb vendor: Western Digital model: WD3200BPVT-22JJ5T0
size: 298.09 GiB
ID-3: /dev/sdf type: USB vendor: Generic model: MS MS-Pro size: 1.86 GiB
Partition:
ID-1: / size: 456.96 GiB used: 210.13 GiB (46.0%) fs: ext4 dev: /dev/sda2
ID-2: /boot/efi size: 511.0 MiB used: 7.8 MiB (1.5%) fs: vfat
dev: /dev/sda1
ID-3: /media/lynntim/688A-CD4E size: 1.86 GiB used: 325.3 MiB (17.1%)
fs: vfat dev: /dev/sdf1
ID-4: /media/lynntim/OS-Install size: 288.06 GiB used: 244.49 GiB (84.9%)
fs: ntfs dev: /dev/sdb4
ID-5: /media/lynntim/System size: 204.0 MiB used: 46.5 MiB (22.8%)
fs: ntfs dev: /dev/sdb2
ID-6: /run/timeshift/backup raw size: 465.26 GiB
size: <superuser/root required> used: <superuser/root required> fs: ext4
dev: /dev/sda2
Sensors:
System Temperatures: cpu: 31.0 C mobo: N/A
Fan Speeds (RPM): N/A
Repos:
No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/gezakovacs-ppa-focal.list
1: deb http://ppa.launchpad.net/gezakovacs/ppa/ubuntu focal main
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http://packages.linuxmint.com ulyssa main upstream import backport #id:linuxmint_main
2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
6: deb http://archive.canonical.com/ubuntu/ focal partner
Info:
Processes: 222 Uptime: 2d 22h 22m Init: systemd runlevel: 5 Compilers:
gcc: 9.3.0 Shell: bash v: 5.0.17 inxi: 3.0.38
lynntim@lynntim-DH61CR:~$ ^C
lynntim@lynntim-DH61CR:~$
[/code]
rene
Level 17
Level 17
Posts: 7543
Joined: Sun Mar 27, 2016 6:58 pm

Re: Unable to delete files

Post by rene »

Assuming that /dev/sdb2 and/or /dev/sdb4 are the filesystems causing you trouble, it seems they are auto-mounted under /media/lynntim/ and not as I suspected configured by you / Disks to mount under e.g. /mnt. That's also immediately to say that chances of this being the originally suggested Windows fast-startup issue after all rather than a normal UNIX-permission one just increased.

Just to be sure: can you move things around when you as suggested rclick an empty part of the folder in your graphical file-manager and open it as root/superuser or whatever the GUI calls it?

If not, we need to reset the NTFS filesystems (by removing the hibernation file) but let's wait for you to confirm that you can't use it as root either.
Tgatim
Level 1
Level 1
Posts: 14
Joined: Thu May 07, 2020 1:02 pm

Re: Unable to delete files

Post by Tgatim »

I can confirm that opening as root does not allow me to move or delete files. Although the Padlock symbol does disappear.
rene
Level 17
Level 17
Posts: 7543
Joined: Sun Mar 27, 2016 6:58 pm

Re: Unable to delete files

Post by rene »

Mmm. Well. I know you posted a lot of information already but what I'd still care for is seeing the output of mount | grep sdb. If in that output you see "ro" instead of "rw" between the brackets I'll give up trying to suggest it's just normal UNIX-permissions :-)

In that case, from a command line, do (just copy and paste it, line for line)

Code: Select all

sudo umount /dev/sdb2
sudo mount -t ntfs-3g -o remove_hiberfile /dev/sdb2 /mnt
sudo umount /dev/sdb2
and the same for /dev/sdb4 (although I expect it's only needed for sdb2 in fact, but oh well)

Code: Select all

sudo umount /dev/sdb4
sudo mount -t ntfs-3g -o remove_hiberfile /dev/sdb4 /mnt
sudo umount /dev/sdb4
and reboot (so as to not have to now arrange for proper UNIX-permission when we'd remount manually).

But note; if there was no "ro" in the output of mount we need to look closer/elsewhere and the above is not needed. It's also slightly "dangerous" since it implies potentially losing changes to the FS that Windows didn't yet commit to disk (although more theoretically dangerous than practically).
Tgatim
Level 1
Level 1
Posts: 14
Joined: Thu May 07, 2020 1:02 pm

Re: Unable to delete files

Post by Tgatim »

I tried that and got the following result:-

[code]lynntim@lynntim-DH61CR:~$ mount greb sdb
mount: only root can do that
lynntim@lynntim-DH61CR:~$ sudo mount greb sdb
[sudo] password for lynntim:
mount: sdb: mount point does not exist.
lynntim@lynntim-DH61CR:~$ mount | grep sdb
/dev/sdb4 on /media/lynntim/OS-Install type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb2 on /media/lynntim/System type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
lynntim@lynntim-DH61CR:~$ sudo umount /dev/sdb2
lynntim@lynntim-DH61CR:~$ sudo mount -t ntfs-3g -o remove_hiberfile /dev/sdb2 /mnt
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sdb2': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.
lynntim@lynntim-DH61CR:~$ sudo umount /dev/sdb2
umount: /dev/sdb2: not mounted.
lynntim@lynntim-DH61CR:~$
[/code]
rene
Level 17
Level 17
Posts: 7543
Joined: Sun Mar 27, 2016 6:58 pm

Re: Unable to delete files

Post by rene »

Tgatim wrote:
Sat May 08, 2021 12:32 pm

Code: Select all

The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.
Yes, well, that state we were trying to fix by doing what is documented for NTFS-3G. I just now ran into a post on an Ubuntu forum that says it worked only on Ubuntu 16.04 (Mint 18...) after moving the -o to the end of the line. That would be so ridiculous I rather doubt it but try I guess. I.e., does it work to instead say

Code: Select all

sudo mount -t ntfs-3g /dev/sdb2 /mnt -o remove_hiberfile 
for the mount command? If so, that's horrible and if not, that's also horrible since I'll have to go figure out ntfsfix instead.

[EDIT] Not finding ntfsfix helpful either. Since it seems we're running into some ridiculous Ubuntu bug, if the above also doesn't help try it as

Code: Select all

sudo ntfs-3g -o remove_hiberfile /dev/sdb2 /mnt
Tgatim
Level 1
Level 1
Posts: 14
Joined: Thu May 07, 2020 1:02 pm

Re: Unable to delete files

Post by Tgatim »

I'll try tomorrow but its getting to the point of giving up. If it doesn't work I'll just copy the files I need and then re-format the drive.
User avatar
spamegg
Level 6
Level 6
Posts: 1186
Joined: Mon Oct 28, 2019 2:34 am

Re: Unable to delete files

Post by spamegg »

This is total overkill but try

Code: Select all

sudo chmod -R o+rwx /dev/sdb2
sudo chmod -R o+rwx /dev/sdb3
sudo chmod -R o+rwx /dev/sdb4
rene
Level 17
Level 17
Posts: 7543
Joined: Sun Mar 27, 2016 6:58 pm

Re: Unable to delete files

Post by rene »

Yah, sorry. I only butted in due to feeling it unlikely that it wasn't just a normal permission issue rather than fast-startup --- but it was fast-startup so I might as well have shut up. Thought I'd then at least instruct how to fix that issue only to then run into some undocumented issue of remove_hiberfile no longer working, or not always, or not on Ubuntu, or...

<sigh>

I suggest that direct ntfs-3g -o remove_hiberfile variant that I edited in. And if that also doesn't work, I dunno.
Post Reply