[Lustre-discuss] How to remove ghost files when running on an LVM snapshot of the MDT?

Andreas Dilger adilger at sun.com
Fri Jul 10 10:01:40 PDT 2009


On Jul 10, 2009  09:19 +0200, Arne Wiebalck wrote:
> I set up a Lustre FS and created 2 files fileA and fileB.
> Then I took an LVM snapshot of the MDT.
> I deleted file B and created a third file fileC.
>
> On the client I saw now files fileA and fileC.
>
> Next, I unmounted the MDT and mounted the snapshot.
>
> On the client, I saw now entries for fileA and fileB, as
> expected, but fileB is not accessible anymore as it has
> been deleted meanwhile.
>
> The goal was now to get the system into a consistent state
> again.
>
> I thought I had to do
>
> e2fsck on the MDT and all the OSTs
> lfsck on the MDT
>
> If that's the wrong approach, please let me know.

This should definitely work.

> This is all to understand what has to be done in order to use
> an LVM snapshot of the MDT in case that's necessary.
>
>>> From what I understood, this requires e2fsck and lfsck. So
>>
>> Well, you can just delete those files.  lfsck isn't strictly
>> necessary.
>
> On the client you mean? That doesn't work:
>
> -->
> [root]# rm fileB
> rm: cannot lstat `fileB': No such file or directory
> <--

Try using "unlink fileB".  The GNU "rm" likes to stat every file before
unlinking it, and the "stat" fails because the OST objects are missing.

>>> I ran e2fsck on the MDT and all the OSTs in order to get the
>>> db files for lfsck, however:
>>>
>>> -->
>>> [root at mds tmp]# lfsck -v --mdsdb mdt --ostdb ost.sdb ost.sdc ost.sdd  
>>> ost.sde /lustre/backup-MDT/dev/mdtgroup/MDT
>>
>> Is this actually where your Lustre filesystem is mounted on the client?
>
> No, that's on the MDT. I thought I need to correct the MDT by running
> lfsck in order to get it in sync again with what is on the OSTs, no?

You need to mount the client filesystem on the MDT in this case.


Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.



Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.




More information about the lustre-discuss mailing list