Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have 3 HDD's and an SSD installed, that can be selectively powered-on by push-button switches - no sense spinning HDD's when they're not needed.
My Linux Mint Cinnamon 19.3 is installed on a 1TB WD Black, and works well.
A week ago, I wanted to transfer some files from the WD drive to the 1TB Toshiba drive, so I powered-it up also before booting to Linux on the WD drive.
Booted O.K. (as usual)
But, when I went to look at the Toshiba drive in "properties", it said "Some contents unreadable" - 50GB roughly.
I wrote a short file to it, and can read it as well.
Any ideas on how to access these 50GB of my files?
My guess is that the logged-on user has no permissions to view some directories on this disk.
In the GUI, you should see the permissions when listing directory details. On the command line, you would use the command ls -l. Also on the command line, cd /media/ralph then du -s * to understand which directory causes the problem.
If it's not a permission problem, the disk may be defective. In this case, you should see relevant messages in the kernel message buffer, which you can display with the dmesg command.
On the contrary, I reckon it's a likely user error. If the OP is in the habit of turning off drives before unmounting, that's a direct route to corruption. On the other hand, if the OP is of good habits, then smartmon would be my next option.
I've never been tempted to power-off a drive before shutting down the computer itself.
If I've forgotten to enable power to a needed drive at boot time, I let the O/S boot, shut it down routinely, enable power to the needed drive, and bring up power again on the computer, letting BIOS discover the drive.
I do not unmount drives before powering down the computer routinely. I assume the O/S looks after this during shut-down.
I installed smartmon. When searching for the pgm, Linux Mint pops up the "Disks" icon. (I've used this icon before.)
(Seems to be a disparity (50 GB) between this and what the disk properties previously reported.)
Nemo (my file manager) shows only the little 156.3kB file that I'd written there to see if the disk was writeable/readable.
It does not show any folders/directories.
Permissions:
Owner: ralph - Ralph
Folder access: Create and delete files
File access: -
Group: ralph
Folder access: -
File access: -
Folder access: None
File access: -
I'm more than a little out of my depth here - 77 years old, and cognitive ability is poorer each morning.
I'm not comfortable with the command line, beyond cut & pasting when I update Calibre.
What bugs me is that the drive is writeable/readable, but there are 50 GB of files that can't be seen.
Is there any merit in powering-off the O/S drive, and booting to a "Rescue disc", using a utility to have a look at this Toshiba drive? And if so, would you have a preference of one flavor of disc over another? Or, will a utility show nothing that the Mint O/S can't show?
I'm less interested in what went wrong, than I am in accessing the files. Sounds like I'm looking for a "quick fix" or "magic bullet", I know. But my abilities are limited.
I'll not fault either of you for moving on to solve others' problems. There's only so much "hand holding" a guy can do.
OK, that's good - I'm now inclined to agree it might be a permissions problem. I hate GUI file managers. Can you post the output of these commands - cut-and paste the long one.
Code:
id
ls -lR /media/ralph | awk '!(NR == 1) {a[$3"_"$4]++} ; END{ for (i in a) print i}'
That is so we can see what id you are and what ids are used in the filesystem - should be easy to fix.
Sorry for casting aspersions on your computer habits ...
No offence taken re: powering off drives, etc. I have a Win10 friend who routinely powers SATA drives in her "toaster" on/off with the system running. I've cautioned her against the practice. Not the way I do business.
Here's the output:
ralph@F2A85-V:~$ id
uid=1000(ralph) gid=1000(ralph) groups=1000(ralph),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),112(lpadmin),128(sambashare)
ralph@F2A85-V:~$ ls -lR /media/ralph | awk '!(NR == 1) {a[$3"_"$4]++} ; END{ for (i in a) print i}'
ls: cannot open directory '/media/ralph/Toshiba/lost+found': Permission denied
_
ralph_ralph
root_root
ralph@F2A85-V:~$
I wrote this output to a text file (366 bytes), and stored it on the Toshiba drive. I can read it, much as I can the other file I'd written to the drive.
Are we getting closer?
Thanks again. It's good to have guys like you and berndbausch in my corner.
Enough of the pessimism. So berndbausch was correct and I was just whistling dixie.
First up, ignore the message about lost+found; that's expected and not relevant to what we're doing.
As you can see it looks like those files are owned by root. If you are sure all those files are yours, the following will change the ownership back to you, and you should be able to do as you wish - from the GUI as well. Use of sudo will ask for your password.
Well that's me out of ideas - I would expect that to have all your files if there had been a problem with the filesystem sometime in the past. The normal next step is to use some forensic software to scrape the disk looking for file signatures. I like PhotoRec - it is well documented and has worked well for me, but needs careful attention to especially navigating the source and allocating a target drive. It needs a separate target drive, and will generate a bunch of directories with files it finds having meaningless names. So it gets the data back usually, but if filenames are important to you, you will have to fix that later. There are tutorials on the webpage.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.