LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-31-2023, 04:10 PM   #16
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931

linux and the desktop has changed a lot in ten years.

Without seeing what you mean by goobledygook it is difficult to say what happened to the drive.

Ubuntu 20 has NTFS read/write support using ntfs-3g installed by default and should normally mount a USB drive at /media/username/xxxxx owned by your username with read/write permissions automatically when inserted.

In Windows you can check the attributes of the drive to see if it is read only and hopefully change it back.
https://www.computerhope.com/issues/ch001617.htm
 
Old 01-31-2023, 06:39 PM   #17
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
i don't use Windows, problem solved. or, rather, never encountered.

there are three ways to keep me from my files:

1. physically destroy the media they are recorded on (including all backups).

2. maybe delete the file and write over the blocks the file was once stored on. reformatting could di this.

3. encrypt the file (and write over the original blocks as above) with an encryption key i do not have the decryption key for (whether the same or different).
 
1 members found this post helpful.
Old 01-31-2023, 06:42 PM   #18
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,371

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
From what you describe I believe the usb has gone bad. Boot into linux open a terminal, plug the questionable usb in and post the output of
Code:
sudo dmesg |tail -20
If there is a "write protect on" message there is a great probability the usb has gone bad.
 
Old 02-01-2023, 05:44 AM   #19
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,647
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
Quote:
Originally Posted by colorpurple21859 View Post
From what you describe I believe the usb has gone bad.
This happened to me with one of my usb sticks that I was using fairly intensively as a backup device. Because these sticks are solid state, they don't like being written to repeatedly and eventually they break down. Linux then treats them as read-only because it can't write to them reliably.

The only solution is to copy the contents to somewhere else and dump the stick. After all, they don't cost much to replace.

Some memory sticks apparently have a little lever that you can move to make them physically read-only and this could get moved by accident. I've never seen such a device, but I suppose it would be worth checking visually to see if you have one.
 
Old 02-02-2023, 03:18 PM   #20
MollyLinux
Member
 
Registered: Jan 2023
Location: Ireland
Distribution: Don't know what that means
Posts: 44

Original Poster
Rep: Reputation: 9
Lightbulb

Quote:
Originally Posted by slac-in-the-box View Post
Then copy and paste back here in this LQ thread, the last few lines that take up your terminal window, but don't select all the gobbledgook above those, and then paste what your selected here for us to see.

What the last lines should contain, is how your computer named your usb stick. Then we can use this name to control it (i.e., we'll figure out what file system is on it, mount it, change the ownership and permissions, and after that, you will feel like the super user of your computer
OK here's a SCREENSHOT of the terminal:
https://drive.google.com/file/d/1Vrs...ew?usp=sharing
(it wouldn't let me copy & paste the text.)
I have included here some lines above the last few, about other USB drives recently used. Just for comparison.
(I already feel my Super Sudo cape flapping in the breeze!)

And here's what the inside of my file folder looks like after Windows did a job on it:
GOBBLEDYGOOK:
https://drive.google.com/file/d/1lvM...ew?usp=sharing

THANKS A MILLION
 
1 members found this post helpful.
Old 02-02-2023, 03:21 PM   #21
MollyLinux
Member
 
Registered: Jan 2023
Location: Ireland
Distribution: Don't know what that means
Posts: 44

Original Poster
Rep: Reputation: 9
P.S. FYI that little "^C" at the bottom is what I got when I tried to select some of the text in the terminal window, and hit "Ctrl-C".
 
Old 02-02-2023, 04:34 PM   #22
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,144
Blog Entries: 21

Rep: Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482
Stick was unmounted improperly.

File system check is needed.

Simple newbie way. Plug in usb drive into your Ubuntu computer.
Open Gparted.
Find your usb drive in the drop down box on the right.
Click it to show drive.
Right click on what is shown and pick unmount < if it shows and not greyed out >
Greyed out mount on right click means it did not mount.
One can use the
Code:
mount
command in terminal to check though.

After those prerequisites are met. Right click again and pic check from the menu.
Takes a while to finish so be patient.

That is what I gathered from your screenshot.

Last edited by rokytnji; 02-02-2023 at 04:36 PM.
 
1 members found this post helpful.
Old 02-02-2023, 06:41 PM   #23
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,246

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
How are you determining when it's safe to physically remove the stick from the computer? You know you can't just pull them out at any time, right?
 
1 members found this post helpful.
Old 02-04-2023, 11:38 AM   #24
MollyLinux
Member
 
Registered: Jan 2023
Location: Ireland
Distribution: Don't know what that means
Posts: 44

Original Poster
Rep: Reputation: 9
THANKS I'll try that
 
Old 02-08-2023, 04:01 PM   #25
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Quote:
Originally Posted by MollyLinux View Post
OK here's a SCREENSHOT of the terminal:
https://drive.google.com/file/d/1Vrs...ew?usp=sharing
Awesome! That screenshot says it all: your thumbdrive is being named sdb (scsi disk b)--scsi is old (well-established) protocol for communiating with serial devices--used to have real wide ribbons to connect to old scanners and the like, and even though your thumbdrive is not one of these old scsi (pronounced "scuzzi" with a short u like cup) devices, many storage devices still use this well established protocol and so get named sda, sdb, sdc, and so on, and referenced in the filesystem in the /dev directory. So to reference that fist partition on your thumb drive when describing it to commands on at the terminal's prompt, you would type:
Code:
/dev/sdb1
That screenshot also informed us that the filesystem on the first partition of your thumbdrive is a FAT filesystem (my mind likes having words to say for the all the letters in techno acronyms, so I see File Allocation Table when I see FAT, even though I am no file system expert and could not tell you how a file allocation table works, knowong the words for the letters, when possible, make it all more familiar somehow, as the combination of letters are nolonger arbitrary sequences, but mere abreviations.

This file system is common on thumb drives because it is recognized by most operating systems without the user having to install additonal packages, and when cleanly unmounted, it mounts read/write on those operating systems. Your screenshot also reports that the FAT file system on your thumbdrive was not cleanly unmounted. (This means that you pulled it out of the usb slot on your computer without first performing the unmount operation on it).

In the graphical clicky file managers, there is the "right click" of the mouse menu that brings up "unmount" on removable media, and so best to right click and select unmount before taking them out of the usb slots. Or, if you are at the terminal prompt, now that we know the name of your device and partiton, we can tell it to unmount it just like chatting to an old pal:
Code:
sudo umount /dev/sdb1
.

After stating that the FAT file system had not been cleanly unmounted, the output in your screenshot suggests running fsck (file system check), and that until you do, the file system will only be mounted in "read-only" mode.

File System Check can do more than check: it repairs. There are more than one way to access it. The way described by rokytnji (running Gparted) will work and Gparted knows how to run fsck for you.

But another way is manually, at the terminal prompt. File System Check has different versions for different file systems, and linux likes to put a V for virtual in front of FAT: virtual file allocation table, and so vfat is how that file system is named in linux, File System Check for Vfat is typed like
Code:
fsck.vfat
. When typing commands to this terminal prompt, sometimes the commands are so powerful, that they need additional instructions on how to be used, and these instructions are usually given in the form of a dash followed by a letter, usually selected to be related to the instructions to be easy to remember, such as "p" for print, or "v" for verbose, or in this example, "a" for automatic. So to tell fsck.vfat to automatically repair the file system, we have to type a "-a" in the command; and to tell it to report what its doing to us (warning might look like gobbldegook, but at least you know its doing something) we give it the verbose flag, "-v", like this:
Code:
sudo fsck.vfat -a -v /dev/sdb1
The file system check and repair only works with the file system already unmounted. After it finishes repairing you can mount the thumbdrive, and it will mount properly with you able to read and write to the file system. To mount the thumbdrive, you can do it automatically by merely removing it and re-inserting it, in which case, your desktop environment will recognize it and automatically mount it for you, but you need to right click and unmount before removing it, or this could happen again.

The mount thing is a strange word to use for what it does: tells linux where in its tree of directories and files to look for the directories and files on your storage device. It uses an empty directory, that it calls a mount point. After mounting a device to a mount point, the directory is no longer empty but filled with the contents of the device. After unmounting a device, the directory is empty again. So when you rip the thumb drive out without unmounting, it thinks all those files are still attached to that directory, which confuses it the next time you plug it in.

All the storage devices connect together with mounts. The one that the operating system starts up from is called the root file system, and it gets mounted at just a "/" for a description of where it is in the tree. Then the first directories in that tree organize linux for us, and it is very common to keep some blank directories to use as mountpoints in both /media, and /mnt. Often ones home folder might be on its own storage device, or partition, and have a separate mount point. All of how and where your computers storage devices get connected to the root mountpoint is described in a file, called fstab, for file system table, and located at /etc/fstab. When you pull your thumb-drive out and replug it in, your desktop envirnoment will select one of the blank mountpoints and mount it for you. But for manual control, you can tell it which blank folder to mount your storage device to.

So instead of removal and re-insertion to trigger your computer to automatically mount your thumbdrive, you could, from that terminal prompt, use the mount command:
Code:
sudo mount /dev/sdb1 /mnt/tmp
After that the contents of your storage device are inside /mnt/tmp. You can use "cd" to change directory to /mnt/tmp and then view what is stored there with "ls" for list. Hopefully, it won't look like the gobbldegook of your second screenshot!

So to put everything together; after sticking in the corrupted sticK:

Code:
umount /dev/sdb1
fsck.vfat -a -v /dev/sdb1
mount /dev/sdb1 /mnt/tmp
cd /mnt/tmp
ls
When I read all of it together, it makes enough sense to me, that it's not too much to remember, and I prefer interacting with my devices at this terminal prompt over remembering when to right click, and which graphical utility application does what I want; the looks and feel to those graphical utilities change from one release to the next, whereas that sequence of steps at the terminal prompt remains constant and nearly immutable, though occasionally the syntax of these commands can change, and occasionally a newer command comes out that does the same thing, but better, so everyone switches... but this is much slower and seems like there's less flux than with the graphical utilities, that I found it rewarding to find out what's going on at that command prompt.

Last edited by slac-in-the-box; 02-08-2023 at 09:36 PM. Reason: fixed erronious info
 
4 members found this post helpful.
Old 02-08-2023, 06:52 PM   #26
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,364

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
Good info above, but fyi, there is no 'n' in the 'umount' cmd ( https://linux.die.net/man/8/umount ) name.
 
2 members found this post helpful.
Old 02-08-2023, 09:34 PM   #27
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
indeed: I was so into expanding acronyms, that I overdid it by a letter ! That is now corrected... good ole peer review--can't even tell you something wrong by accident!

Last edited by slac-in-the-box; 02-08-2023 at 09:42 PM.
 
1 members found this post helpful.
Old 02-09-2023, 04:05 AM   #28
MollyLinux
Member
 
Registered: Jan 2023
Location: Ireland
Distribution: Don't know what that means
Posts: 44

Original Poster
Rep: Reputation: 9
You & Linux q's are Totally AWSUM!
Now I have to manage to sit down & study all this until I'm sure I can proceed without accidentally hitting the ejector seat!

Maybe today... Or...
A million THANKS
 
Old 02-09-2023, 05:57 AM   #29
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,647
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
@Slac-in-the-box: I think you should rewrite post 25 as a blog or wiki entry. It's really informative and well-written.

Last edited by hazel; 02-09-2023 at 05:59 AM.
 
1 members found this post helpful.
Old 02-10-2023, 09:55 AM   #30
MollyLinux
Member
 
Registered: Jan 2023
Location: Ireland
Distribution: Don't know what that means
Posts: 44

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by dugan View Post
How are you determining when it's safe to physically remove the stick from the computer? You know you can't just pull them out at any time, right?
Yes, thank you, I know that.

Due to another experience with otherwise-wonderful Linux... When I first started using it, around 2012, I always carefully waited for the "Now safe to remove your stick" prompt.
One day... that prompt appeared. I started pulling out the stick. In the midst of the second or so that it was coming out, Linux suddenly started writing to the stick.

Everything on it was erased.

Since then, I NEVER trust any "Eject" function anywhere.
I insert a stick while the computer is awake.

To remove a stick, I close all windows where it's open.
Then put the computer to SLEEP.
Then pull out the stick.
Then wake it up.
I'm wondering now if something in that process might ever have gone awry.
(Sometimes a computer might not "like" it, if the window where the stick was being viewed is still open, and it wakes up & finds it's not plugged in anymore.
Usually I avoid that. But it's possible in a bleary moment I may ever have skipped that step sometime.)
(That's also when I decided just never to put a stick into Linux (aside from getting locked out of files.)
Anything requiring a lot of work with a stick, I'd just do it on the Windows side.)

(Incidentally, clarification / sidelights on my experience / background (maybe I should have put it on my profile page: but I've privacy issues)...
I worked in the corporate world since 1988 on every type of word processing system since. On many systems you've probably never heard of.
Perhaps some I now look up to for guidance weren't born then! (I'm glad you were born!)
When I was a child, a relative excitedly rang to say, "Guess what, at my new job, we have a Computer!" He took me to see it. It filled the entire basement, and had to be kept at a certain temperature by air conditioning at all times. He started teaching me a bit about Fortran. I have coded a bit at moments. But wouldn't call myself a "coder".)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to setup PAM to lock out after so many login attempts is locking me out JockVSJock Linux - Security 0 05-11-2016 10:48 PM
LXer: Microsoft Denies Locking out Linux Stories LXer Syndicated Linux News 0 09-26-2011 03:50 PM
Secure Boot for Windows 8- Locking Out Linux Mr. Bill Linux - News 1 09-26-2011 09:37 AM
LXer: Will Windows 8 succeed in locking out GNU/Linux? LXer Syndicated Linux News 4 09-21-2011 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration