accidentally deleted very large file (3.5TB) but still available through loop device

Chris Allen chris at cjx.com
Thu Mar 26 11:43:33 CDT 2009



Eric Sandeen wrote:
> Chris Allen wrote:
>   
>> Hi,
>>
>> In a nutshell, I did the following:
>>
>> 1. dd if=some_filesystem_dump of=some_file (where some_file resides on
>> an XFS filesystem and is 3.5TB large)
>>
>> 2. losetup /dev/loop0 some_file
>>
>> 3. mount /dev/loop0 /recovered
>>
>> [.... i can now access my recovered filesystem through /recovered ...]
>>
>> 4. rm some_file (remotely via an nfs export) (oops!)
>>
>> So, I just removed my 3.5TB file even though it is attached to the loop
>> device and mounted (XFS did this almost instantly).
>>
>>     
> I'd suggest:
>
> # xfs_freeze -f /recovered
> # dd if=/dev/loop0 of=saved_file
> # xfs_freeze -u /recovered
>
> to be sure you get a consistent view of the fs.
>
> -Eric
>   

Many thanks to those who have replied. This solution does indeed work 
perfectly and
I have recovered my lost file.

Chris.




More information about the xfs mailing list