Author Topic: Locked files on USB sticks in Linux Mint 19.3 [SOLVED]  (Read 5981 times)

0 Members and 1 Guest are viewing this topic.

Offline 19goalie50nxQ

  • Jr. Member
  • **
  • Posts: 97
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Locked files on USB sticks in Linux Mint 19.3 [SOLVED]
« on: January 18, 2021, 03:08:39 pm »
I’m using Linux Mint “Tricia” 19.3 Cinnamon 64 bit ISO and use usb sticks to store folders and files. Using the sticks recently after I have entered files into the folders and then removed the stick from the computer. Next time I use the stick I can open it but a number of the folders/files are “locked” in read only. What causes this and how can I unlock the folders/files. I have this problem on a number of my usb sticks both new and old re-used ones..

Regards
Goalie
« Last Edit: January 24, 2021, 02:24:07 pm by Keith »

Offline DavidMcCann

  • Jr. Member
  • **
  • Posts: 75
  • Karma: 4
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #1 on: January 18, 2021, 05:15:26 pm »
Firstly, have you checked the permissions of the locked files using your file manager? It may be as simple as that, although I'm not sure how the permissions could have gone wrong.

Secondly, did you remember to unmount the devices before unplugging them? If you didn't, then this can cause corruption. Usually this makes the whole device read-only, though — the idea behind that is to stop you making a bad thing worse. You can try to clean up any corruption with fsck.
https://linux.die.net/man/8/fsck

The Linux Community Forum

Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #1 on: January 18, 2021, 05:15:26 pm »

Offline 19goalie50nxQ

  • Jr. Member
  • **
  • Posts: 97
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #2 on: January 19, 2021, 09:54:19 am »
Hi David.

First not sure how to check the permissions of the locked file can you explain how to do it.

Secondly I always unmount the usb sticks before unplugging them.
I'll have a look at  'fsck' although being a novice in Linux I may find it difficult to fully understand how to use it.

Goalie

Offline Keith

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1494
  • Karma: 20
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #3 on: January 19, 2021, 11:31:09 am »
Hello Goalie.

Even if the file is locked one ought to be able to list the file permissions as follows:  In a terminal, navigate to the directory containing your file and then:
Code: [Select]
ls -l filename
....substituting your file name, obviously!  This will show you lots of info about your file.  Please paste the output here.
To give you an idea of what to expect, here's something from my PC:
[email protected]:~$ ls -l mail.txt
-rw-rw-r-- 1 keith keith 68 Apr 22  2020 mail.txt
[email protected]:~$
The bits in blue are the file permissions that we can change if necessary - and I'll explain what they mean.

Keith

Offline 19goalie50nxQ

  • Jr. Member
  • **
  • Posts: 97
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #4 on: January 19, 2021, 12:51:59 pm »
Hello Keith.

Nice to hear from you again, I'm feeling a bit foolish but I don't know how to  "In a terminal, navigate to the directory containing your file and then" I've tried various ways but have to ask the experts. I assume that I have to have the usb with the 'locked' files plugged in to be able to find the 'locked ' files. So I've plugged one in and opened Terminal now how do I proceed from here?

Goalie

The Linux Community Forum

Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #4 on: January 19, 2021, 12:51:59 pm »

Offline Keith

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1494
  • Karma: 20
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #5 on: January 19, 2021, 01:10:33 pm »
My apologies - I ought to have read right from the start!

Ensure only one device in plugged into a USB port.  Then enter
Code: [Select]
df | grep media
The "|" symbol is near the bottom left of your keyboard.
The text that appears look for /media/...etc....  Copy everything from /media to the end of that line  (use Ctrl+Shift+c).  Then change the directory to that one by:
Code: [Select]
cd <paste it here>
without the "<>" brackets. Paste using Ctrl+Shift+v
Then enter the command I mentioned earlier:
Code: [Select]
ls -l filename
...entering the appropriate file name.  Please post all the output from these commands. 

Keith
« Last Edit: January 19, 2021, 01:12:54 pm by Keith »

Offline 19goalie50nxQ

  • Jr. Member
  • **
  • Posts: 97
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #6 on: January 19, 2021, 02:26:30 pm »
Keith.

Got there in the end, kept mis-reading your instructions this is the result of your instructions :- 

[email protected]:~$ df | grep media
/dev/sdb1       60456992 43655168  16801824  73% /media/kevin/PHILIPS UFD
[email protected]:~$ cd </media/kevin/PHILIPS UFD>/media/kevin/PHILIPS UFD ls -l

Now when I went back to check which  filename to put into the end of last command, I noticed that all the "locked" folders had been "Unlocked" (no padlock icons) and was able to open the files as normal (not read only).
So Keith is this the result you were hoping for?

Goalie

Offline 19goalie50nxQ

  • Jr. Member
  • **
  • Posts: 97
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #7 on: January 19, 2021, 02:38:05 pm »
Sorry Keith.

Spoke to soon, just rechecked my usb folders and files and noticed that the xls files and doc are still in "read only" format but not showing any 'padlock' icon but the 'pdf' and 'photo' files are okay.

So we are nearly there do I have to go through all the 'read only' files individually to resolve this?

Goalie

Offline Keith

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1494
  • Karma: 20
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #8 on: January 19, 2021, 03:04:47 pm »
Your command
cd </media/kevin/PHILIPS UFD>/media/kevin/PHILIPS UFD ls -l
is not correct.  You left the "<>" in!!  and you didn't press "Enter" after the "UFD".  The ls-l ought to be a new command on a new line. 
In fact you have another problem:  The USB name is in two parts with a space between them so we need to change things a bit.

Enter
Code: [Select]
cd "/media/kevin/PHILIPS UFD"
Note the inverted commas at start and end.  AND PRESS the "Enter" key!!
Then
Code: [Select]
ls -l 
This should list all the file names on your USB stick.  Please list ALL the output including your user prompts.

Keith

The Linux Community Forum

Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #8 on: January 19, 2021, 03:04:47 pm »

Offline 19goalie50nxQ

  • Jr. Member
  • **
  • Posts: 97
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #9 on: January 19, 2021, 04:38:21 pm »
Keith.

I hope I'm not giving you a hard time. Here is the result of my attempt at following your commands and I don't think its come out as you expected.

[email protected]:~$ cd "/media/kevin/PHILIPS UFD" ls -l
bash: cd: too many arguments
[email protected]desktop:~$

Goalie

Offline DavidMcCann

  • Jr. Member
  • **
  • Posts: 75
  • Karma: 4
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #10 on: January 19, 2021, 04:46:38 pm »
Again, you've run two command into one!
Code: [Select]
cd "/media/kevin/PHILIPS UFD"
ls -l
That's why I recommend the use of the GUI rather than the command line. You obviously can use that, as you say you saw a padlock on a folder or file. Right-click on the offending item and select the option Properties. There you can check the permissions and see who owns the file and what access is allowed.

Offline Keith

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1494
  • Karma: 20
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #11 on: January 19, 2021, 04:48:05 pm »
Ah, Goalie!!! 

You entered cd "/media/kevin/PHILIPS UFD" ls -l although I asked to to enter cd "/media/kevin/PHILIPS UFD" and then press the "Enter" key as the first command and then enter ls -l as a separate command.   ::)

Here's one of mine:
[email protected]:~$ df | grep media
/dev/sdb1       30259440    30960  30228480   1% /media/keith/TOSHIBA
[email protected]:~$ ls -l /media/keith/TOSHIBA
total 15792
-rw-r--r-- 1 keith keith  690907 Apr 19  2017 100_3814.JPG
-rw-r--r-- 1 keith keith  430200 Apr  9  2017 100_3889.JPG
-rw-r--r-- 1 keith keith  615019 Apr 18  2017 100_3915.JPG
-rw-r--r-- 1 keith keith  379723 Apr 30  2017 100_3962.JPG
[email protected]:~$ umount /media/keith/TOSHIBA
[email protected]:~$

Have another go ;)

Offline emegra

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 1
  • Gender: Male
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #12 on: January 19, 2021, 04:49:12 pm »
Hi goalie

Your inputting 2 commands at the same time you need to remove the apostrophes & the ls -l at the end
another problem could be the blank space between PHILIPS & UFD

copy & paste the following command at the command prompt

Code: [Select]
cd /media/kevin/PHILIPS\ UFD

then once you're in the PHILIPS UFD directory

Code: [Select]
ls -l

then post the output



Graeme
If you can keep your head while all around are losing theirs then you're not quite grasping the situation

Offline Keith

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1494
  • Karma: 20
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #13 on: January 19, 2021, 04:54:35 pm »
Hi Graeme.

The apostrophes should obviate the need for the escape sequence - and I though it would look less confusing.  At least for me. ;)

Keith

Offline emegra

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 1
  • Gender: Male
  • I've just joined!
    • View Profile
    • Awards
Re: Locked files on USB sticks in Linux Mint 19.3
« Reply #14 on: January 19, 2021, 05:01:07 pm »
Quote
The apostrophes should obviate the need for the escape sequence - and I though it would look less confusing.  At least for me.

My apologies Keith I didn't know that :)





Graeme
If you can keep your head while all around are losing theirs then you're not quite grasping the situation

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal