LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Lost + found? (https://www.linuxquestions.org/questions/linux-newbie-8/lost-found-674527/)

Odyssey1942 10-06-2008 05:26 AM

Lost + found?
 
The hdd (500GB SATA) of my new Ubuntu 8.04 install is set up:

Primary partitions:
sda1 46.7 GB NTFS (Cannot for the life of me remember why I formated sda1 as NTFS.)
sda2 1.86 /swap
sda3 7.45 /
Extended:
sda4 409.88
sda5 37.25 /home
sda6 372.66 /media/disk

Under "Places" there appear two (slightly different icons, presumeably having to do with the different formatting): 50 GB Media and 400.1 GB Media. These appear to be sda1 and sda6 respectively.

When I click on the 400 GB icon, it shows only one folder: Lost + Found, size 0, with properties as: contents unreadable and 350.9GB of free disk space. One forum post says:

Quote:
lost+found is a directory that fsck uses to store any unconnected files or directories it finds after a dirty shutdown

Don't recall any traumatic shutdowns, but I found all of this as a result of trying to copy files from my windows computer into this partition and got a "no permission to write to this.." denial. And when I right click into the empty space below the "Lost + Found" the Create Folder, Create Document, and Paste options are all greyed out. Also cannot delete the Lost + Found folder.

Any ideas how to figure out what, if anything, is in Lost + Found (doubt it), how to delete it, and what to do about restoring permissions?

jschiwal 10-06-2008 06:26 AM

Open up a terminal like konsole or gterm and use "sudo ls lost+found". It might be empty. If there are files in it, they will be named after the inode numbers. These are files and directories that were found but the directory entries for them were damaged, so you don't know the filenames. The file command will examine the contents of a file to determine what it is. Then you will have an idea what application you can use to examine them.

The lost+found directory should have rwx permissions for root.

onebuck 10-06-2008 07:28 AM

Hi,

I would use the ; 'sudo ls -al lost+found' from the cli. That way you will get the directory/file permissions with these options. You could 'man ls' to get a better understanding of the command.

NVRAM 10-06-2008 04:23 PM

First, I should say that it looks like things are fine. You aren't running as root, which is great. However, the mount point under which you're trying to copy files doesn't allow your user to do so.

So, you'll want to:
  • Open a command prompt (terminal window or Ctrl+Alt+F2), and
  • If not logged in as root, run: su - (I suggest you always use the dash)
  • Determine the mount point for the drive/partition in question (see below),
  • Create a user-owned directory under the mount point. If it is /media/disk then:
    Code:

    cd /media/disk
    ls -ld
    mkdir files
    chown yourlogin files
    chgrp yourgroup files

At that point, you may find everything works as you want.
Quote:

Originally Posted by Odyssey1942 (Post 3301634)
The hdd (500GB SATA) of my new Ubuntu 8.04 install is set up:

Primary partitions:
sda1 46.7 GB NTFS (Cannot for the life of me remember why I formated sda1 as NTFS.)
sda2 1.86 /swap
sda3 7.45 /
Extended:
sda4 409.88
sda5 37.25 /home
sda6 372.66 /media/diskExtended:
sda4 409.88
sda5 37.25 /home
sda6 372.66 /media/disk

Notice that you don't have a "400.1GB" partition on this drive of any kind. Did you name the icon? Could it be there is another drive mounted?

If problems persist, run these and post the output:
fdisk -l | grep ^/dev
mount
df -h


- NVRAM

It's rare with on Linux (especially with a journalled file system) installation to have any files under the 'lost+found' directory.


As an aside: quoting output from GUI clients for system can make it nearly impossible for some of us (who aren't running Ubuntu) to help you. Please learn and love the CLI tools: the core ones are almost always the same between distros so we can more easily help, plus it means cut/paste will work, too.

That said, here is a list of CLI programs you may wish to read about, and which may help here: du df mount find fdisk chown chgrp

Oh, if you use Ctrl+Alt+F2 to get a console prompt, use Ctrl+F7 or Ctrl+F8 (or similar) to get back to X11.

Odyssey1942 10-07-2008 02:08 PM

Misery. I just spent an enormous amount of time composing a response and inadvertently deleted it. Argggggg! Here goes again.

NVRAM, Thanks for yours.

Quote:

As an aside: quoting output from GUI clients for system can make it nearly impossible for some of us (who aren't running Ubuntu) to help you. Please learn and love the CLI tools: the core ones are almost always the same between distros so we can more easily help, plus it means cut/paste will work, too.
I would like to be cli competent, but at my level of linux experience, the cli is very daunting and I have a hard time finding guidance that I can understand, and the man pages are at the top of the list of the ones that I cannot. I want to elevate my cli skills but because my use of it is usually only for problem solving, e.g., when I do a new install, not much sticks. Your kindness in having provided character by character guidance will probably make the difference between success and failure and I am most grateful.
Thanks again.

Quote:

Extended:
sda4 409.88
sda5 37.25 /home
sda6 372.66 /media/disk
Notice that you don't have a "400.1GB" partition on this drive of any kind. Did you name the icon? Could it be there is another drive mounted?
I may be off base here, but I think the two partitions sda5 & 6 constitute (logical?) partitions totaling 410.91 GTB making up the Extended partition (sda4) of 409.88. No? I recognize that the numbers are not equal, but when I am looking at partitions, the numbers never seem to add up for me. There definitely is no second hdd.

Anyway, I have managed to get into /device/disk and using: sudo ls -al lost+found:
Thanks again.

drwx------ 2 root root 16384 2008-09-23 13:03 .
drwxr-xr-x 3 root root 4096 2008-09-23 13:03 .

so these are directories, not files, no? If so, then there does not appear to be a problem associated with them and now I just need to work through the permissions thing.

So will work on that and come back with questions. If any of the above (partition stuff?) warrants your further comments, they are very welcome.

Thanks again.

onebuck 10-07-2008 03:36 PM

Hi,

Quote:

Originally Posted by Odyssey1942 (Post 3303178)
<snip>

I would like to be cli competent, but at my level of linux experience, the cli is very daunting and I have a hard time finding guidance that I can understand, and the man pages are at the top of the list of the ones that I cannot. I want to elevate my cli skills but because my use of it is usually only for problem solving, e.g., when I do a new install, not much sticks. Your kindness in having provided character by character guidance will probably make the difference between success and failure and I am most grateful.
Thanks again.
<snip>

I would suggest that you look at the next links to assist you with your cli needs;

Odyssey1942 10-07-2008 04:35 PM

Onebuck, Thanks for yours. In the deleted post, I had included a thank you for the URLs which were in your earlier post, but forgot to mention it in the reconstructed one. I am not only reading them but have committed them to my bookmarks and will copy bits into my desktop reference files.

NVRAM, your code worked like a charm, thanks again. Copying files over now. I'm astonished at how slow it is though.

NVRAM 10-07-2008 04:44 PM

Quote:

Originally Posted by Odyssey1942 (Post 3303178)
I may be off base here, but I think the two partitions sda5 & 6 constitute (logical?) partitions totaling 410.91 GTB making up the Extended partition (sda4) of 409.88. No?

From what you've posted, you are exactly right.

My point was that given the discrepancy between the numbers and the name of the "400.01GB" icon you mentioned might be another partition. But if there's only one HD and it's ~500GB, then that's not possible.

Quote:

Originally Posted by Odyssey1942 (Post 3303178)
Anyway, I have managed to get into /device/disk and using: sudo ls -al lost+found:
Thanks again.

drwx------ 2 root root 16384 2008-09-23 13:03 .
drwxr-xr-x 3 root root 4096 2008-09-23 13:03 ..

so these are directories, not files, no? If so, then there does not appear to be a problem associated with them and now I just need to work through the permissions thing.

It seems you left off the second dot of the second line (".." not ".").

And yes, the very first character indicates what type of file it is ('d' = directory, '-' = regular file, 'l' = symbolic link, etc.).
the next 9 characters, taken in 3 triplets (sets of 3), show the permissions for owner, group and other, respectively.

The second line ("..") shows the parent directory, in this case the mount point, is indeed writable only by root -- the 1st "root" tells the owner/UID, and the only 'w' is in the first (owner) triplet.

Quote:

Originally Posted by Odyssey1942 (Post 3303353)
NVRAM, your code worked like a charm, thanks again. Copying files over now. I'm astonished at how slow it is though.

Glad to help.

dasy2k1 10-07-2008 05:31 PM

The Lost+found folder is created when the partiotion is formatted to ext2/3 (the most common linux filesystem) generally noting will be in it and everthing will be fine, but if somthing has gone AWOL after a messy powerdown (eg power outage) then its a good place to look


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