Retrieving files from lost+found folder

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
ACS1986
Level 1
Level 1
Posts: 13
Joined: Fri May 19, 2017 12:54 pm

Retrieving files from lost+found folder

Post by ACS1986 » Mon Jun 26, 2017 10:03 am

Hi,

I've been running Linux Mint 18.1 (Cinnamon)/dual-booted with Windows for about 2 months. This has mostly been without problem, but my computer has crashed twice during booting during the past week.

Then yesterday my system failed to boot at all, stating that I needed to manually run fsck. I booted mint from a USB and ran fsck on the affected partition. I thought everything was fixed as I can now boot normally, However, fsck seems to have deposited all my personal files in a folder called lost+found. At this stage I've convinced myself that a clean install might be the best idea. I only need to retrieve a minority of my files which weren't backed up. I've located them in the lost+found folder, which I can access by selecting "open as Root", however I can't move files from this folder because apparently I don't have permission.

Could somebody kindly explain how to retrieve my files from this folder and also how to reinstall mint on the same partition so that I can start afresh? I can follow instructions, but I'm a novice when it comes to Linux and not yet familiar with using the Terminal, so please bear this in mind when giving instructions.

Many thanks,

Adam

Cosmo.
Level 23
Level 23
Posts: 17830
Joined: Sat Dec 06, 2014 7:34 am

Re: Retrieving files from lost+found folder

Post by Cosmo. » Mon Jun 26, 2017 10:59 am

Don't try to move the files, but copy them to the target (backup) folder.

ACS1986
Level 1
Level 1
Posts: 13
Joined: Fri May 19, 2017 12:54 pm

Re: Retrieving files from lost+found folder

Post by ACS1986 » Mon Jun 26, 2017 11:24 am

Hi Cosmo, thanks for your reply.

I tried copying first and I get the "Error while copying" dialogue box when I attempt to paste them in the target folder. If I click on "more details" it says "Error opening file: Permission denied". It seems that clicking the 'open as Root' option to open the lost+found folder is only giving me read only access. If I understand correctly Root is the equivalent of the Administrator account in Windows. Is there a way to log in as Root and would this solve the problem?

Adam

Mute Ant
Level 13
Level 13
Posts: 4787
Joined: Tue Sep 03, 2013 7:45 pm

Re: Retrieving files from lost+found folder

Post by Mute Ant » Mon Jun 26, 2017 1:03 pm

<<don't try to move the files>> Copy what you can to another drive, read-only is fine for that, because really soon now you need to 'shred' the damaged partition and re-format. The Disks accessory can do that, write zeros over the whole partition...over the whole drive if there's nothing you need to keep. While in Disks take a look at the drive's self-assessment. Does the SMART think the drive's in trouble?
In Chapter One, Boron slays the entire Marketing Department by explaining Asynchronous Protocols.

Cosmo.
Level 23
Level 23
Posts: 17830
Joined: Sat Dec 06, 2014 7:34 am

Re: Retrieving files from lost+found folder

Post by Cosmo. » Mon Jun 26, 2017 4:42 pm

ACS1986 wrote:If I understand correctly Root is the equivalent of the Administrator account in Windows. Is there a way to log in as Root and would this solve the problem?
Simply spoken: root and the Windows adm account are something similar, but technically quite different. Login in as root is not advisable and not needed.

2 tries: From the file manager GUI (with elevated rights) don't use copy and paste, but the context copy command. You need to expand the context menu at first, to make this command visible; you do this by clicking the + icon in the top most menu line. Further more I suggest, that you open 2 panes (press F3), one for the source directory, one for the target.

Another attempt: Open the terminal and enter sudo -i. Now you are in the root terminal. You can copy with the command line: cp source target.

ACS1986
Level 1
Level 1
Posts: 13
Joined: Fri May 19, 2017 12:54 pm

Re: Retrieving files from lost+found folder

Post by ACS1986 » Mon Jun 26, 2017 6:18 pm

Many thanks Cosmo, the context copy option worked. My data is safely backed up.

I've just looked at the Disks utility as Mute Ant suggests and its assessment is "Disk is OK, 2 bad sectors (37° C/99° F)". Are a couple of bad sectors fairly normal or a sign that the disk is dying?

Cosmo.
Level 23
Level 23
Posts: 17830
Joined: Sat Dec 06, 2014 7:34 am

Re: Retrieving files from lost+found folder

Post by Cosmo. » Mon Jun 26, 2017 6:35 pm

2 bad sectors are not normal. This does not necessarily mean, that the drive is dying, but it can mean that. Watch the drive in the future very carefully and make especially often and regularly backups for the case, that the drive will actually fail. Don't expect, that the complete failure - if it should happen - announces itself with a gradually increase of the number of bad sectors; a complete fail can happen from today to tomorrow without further announcement.

Sum up: As long as you need to use the drive: no day without at least one backup of your user data on an external drive.

Laugh2
Level 3
Level 3
Posts: 163
Joined: Fri Aug 16, 2013 4:01 am

Re: Retrieving files from lost+found folder

Post by Laugh2 » Fri May 18, 2018 5:33 pm

Cosmo. wrote:
Mon Jun 26, 2017 4:42 pm
ACS1986 wrote:If I understand correctly Root is the equivalent of the Administrator account in Windows. Is there a way to log in as Root and would this solve the problem?
Simply spoken: root and the Windows adm account are something similar, but technically quite different. Login in as root is not advisable and not needed.

2 tries: From the file manager GUI (with elevated rights) don't use copy and paste, but the context copy command. You need to expand the context menu at first, to make this command visible; you do this by clicking the + icon in the top most menu line. Further more I suggest, that you open 2 panes (press F3), one for the source directory, one for the target.

Another attempt: Open the terminal and enter sudo -i. Now you are in the root terminal. You can copy with the command line: cp source target.
Hi Cosmo,
I have a similar problem after system crashed so from LiveUSB I'm making a backup before fresh install of latest version. Although most files copied OK some wouldn't citing permission issues. I'm using Mint MATE. I started Caja from CLI using gksudo caja. Caja then ran as Superuser but I'm still getting "Error opening file: Permission denied" or similar for a few files when copying. Caja doesn't have a + sign to expand the context menu so the normal copy option is presumably not sufficient. How do I get an expanded context menu for MATE Caja?

I also tried sudo -i then cp source target using "Ctrl L" in the GUI with copy/paste for both source and destination. Unfortunately although Caja found the folders the CLI said it couldn't find them and my attempts with "*" and "*.*" (as with DOS from years past) didn't help. Presumably I'm not specifying source and destination as cp would like?

What can I do to copy all the files, not just almost all of them?

Post Reply

Return to “Other topics”