🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.redhat.install
Article #50

Re: Removing files from /lost+found

#50
From: John Saunders
Date: Fri, 22 May 1998 00:00
55 lines
3323 bytes
Brian McCauley wrote in message ...
>david Bowie <dbowie@turing.une.edu.au> writes:
>
>> Listed below are a selection of files stubbornly residing in
>> /lost+found. I've managed to remove most of
>> them but still over 1000 remain.
>
>These will be corrupt, immuable, device inodes.  You can only get rid
>of them with a low-level filesystem editor (see previous posts on the
>topic) as chattr does not work on device inodes for non-existant
>devices.

The only way to really clear these is to boot up single user
mode with the disk unmounted (or mounted read-only if it's the
root filesystem). Make a list of the file (The #nnnn number is
the inode number, you can confirm this by doing ls -i) inodes
into a file. Edit the file so that it's a list of commands like

    clri <inode-number>

With with <inode-number> replaced by the inode number of
the file, of course. You can do this by...

    cd /lost+found ; ls -i | awk '{print $1}' | sed -e '1,$ s/^/clri /'
>script_file

Then run debugfs with the -w and -f option to clear the inodes.
When debugfs exits, run a full e2fsck. This should detect the now
unreferenced files from lost+found and remove them.

    debugfs -w -f script_file
    e2fsck -fvy /dev/...

I had a machine once that use to mangle the news spool once a
week (turned out to be memory problems). Anyway this proceedure
became second nature.

Oh yeah, almost forgot the disclaimer. What you are about to do
is serious black magic so anything you trash is your own
responsibly. :) Make sure to read up the man pages first.

>My advice is that unless you are running low on inodes (do "df -i")
>that you simply move them to a graveyard directory and forget about
>them.


That's certainly the easiest way :)

Cheers.
--   .   +-------------------------------------------------------+
 ,--_|\  | John Saunders    mailto:John.Saunders@scitec.com.au   |
/  Oz  \ | SCITEC LIMITED   Phone +61294289563  Fax +61294289933 |
\_,--\_/ | "By the time you make ends meet, they move the ends." |
      v  +-------------------------------------------------------+
Technical Details
Message-ID: <6k31cc$65e@mailhub.scitec.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3563CE81.56C6EFF1@turing.une.edu.au> <td8d8c5bc.fsf@wcl-l.bham.ac.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd6c,1ad5fe5d5ea6b45c
X-Google-Attributes: gidfcd6c,public
X-Google-Thread: 111240,1ad5fe5d5ea6b45c
X-Google-Attributes: gid111240,public
X-Google-Thread: 15ee82,1ad5fe5d5ea6b45c
X-Google-Attributes: gid15ee82,public
X-Google-Thread: 1103af,1ad5fe5d5ea6b45c
X-Google-Attributes: gid1103af,public
X-Google-Thread: faa64,1ad5fe5d5ea6b45c
X-Google-Attributes: gidfaa64,public
X-Google-Thread: fe2cf,1ad5fe5d5ea6b45c
X-Google-Attributes: gidfe2cf,public
X-Google-Thread: 102983,1ad5fe5d5ea6b45c
X-Google-Attributes: gid102983,public
From: "John Saunders" <john.saunders@scitec.com.au.NOSPAM>
Subject: Re: Removing files from /lost+found
Date: 1998/05/22
Message-ID: <6k31cc$65e@mailhub.scitec.com.au>
X-Deja-AN: 355457269
Content-Transfer-Encoding: 7bit
References: <3563CE81.56C6EFF1@turing.une.edu.au> <td8d8c5bc.fsf@wcl-l.bham.ac.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: SCITEC LIMITED
Newsgroups: linux.redhat.install,alt.lnux,alt.os.linux,aus.computers.linux,comp.os.linux.misc,linux.redhat,linux.redhat.misc