Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ( ). 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?


share|improve this question
up vote 7 down vote accepted

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


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

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:

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

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

share|improve this answer
That's what I did in the end back then (I should have gone back to answer). But pivot_root would have been the better choice had I known. – Thomas Wang Nov 26 '14 at 2:16

No, this is not doable on this earth.

share|improve this answer
Nor in the universe. – mailq Aug 13 '11 at 14:38
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

Your Answer


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.