Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a server that I can access through SSH. There is no KVM available and there's only one root partition for the whole server. I have deleted some files that I shouldn't have and want to recover them with extundelete ( http://extundelete.sourceforge.net/ ). For this I need to unmount the targeted file system.

Is there a way to unmount the root file system without rebooting? Maybe by doing something similar to what initrd does to boot a system before mounting the root filesystem on some systems?

Thanks

share|improve this question
add comment

4 Answers

How about using pivot_root to switch to a temporary, in-memory filesystem root?

See http://www.ivarch.com/blogs/oss/2007/01/resize-a-live-root-fs-a-howto.shtml.

share|improve this answer
    
I wish I'd seen this question when it was first asked, for this is the answer to give. pivot_root is used by many distros during boot to move from an in-memory FS to the disk one. It can certainly be used again to move the other way. –  Jeff Ferland Aug 3 '12 at 23:33
add comment

I would try to get someone to help you with a live rescue CD like the PLD Linux Rescue disk. But only having ssh access, no KVM, no ILO, no backups, etc. is pretty risky.

One other option is to install the free Hot Copy snapshotting utility from R1Soft(hcp): See: http://www.r1soft.com/tools/linux-hot-copy/

It would allow you to take a read-only snapshot of your root partition and mount it to a subdirectory. You could run your undelete/repair utility against the snapshot mount.

share|improve this answer
    
I would love to have someone help me with a rescue CD. But from my past experience with the abysmal level of incompetence of my host, I doubt I could get them to help me... R1soft sounds interesting... –  Thomas Wang Aug 13 '11 at 19:00
    
Well, the R1Soft Hot Copy will definitely work to give you a read-only snapshot without needing a reboot. What flavor/version of Linux are you running? R1Soft have pre-built modules available for most kernel versions, but your system will need internet access in order to download the appropriate module. This may be your best bet. –  ewwhite Aug 13 '11 at 20:27
    
Ok, I've been looking at R1Soft Hot Copy and it seems that they store the snapshot in the unused space on my partition, which would run the risk of overwriting the deleted files... I'll ask them some questions... –  Thomas Wang Aug 14 '11 at 3:19
add comment

you could use dd and netcat to copy the disk/partition somewhere else and do the recovery there

share|improve this answer
add comment

No, this is not doable on this earth.

share|improve this answer
2  
Nor in the universe. –  mailq Aug 13 '11 at 14:38
2  
Or, in any other universe. –  EightBitTony Aug 13 '11 at 15:01
    
@EightBitTony: Who knows what is possible in other universes ;) –  Iain Aug 13 '11 at 17:15
    
silly answers are not useful –  Michael Dillon Aug 14 '11 at 6:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.