Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to access my "root" ZFS dataset to delete a file under "/var". But "/var" is overlayed by another ZFS dataset. Since these are system datasets I can't "umount" them while the machine is running. And I want to avoid to reboot the system in "failsafe" mode, since this is a production machine.

Teorically ZFS would refuse to mount "/var" dataset over the underlying "/var", because it is not empty. But it works, possibly because they are system datasets mounted early in the boot process.

But having the underlying "/var" not empty is preventing me to create an ABE (Alternate Boot Environment), so patching is risky, and I can't upgrade my system using Live Upgrade.

The machine is remote. I have an IP KVM, but I rather prefer to avoid booting this machine in "failsafe" mode, if I can.

I know there is a file in "/var/" because I can snapshot the "root" dataset and check it. But snapshots are read-only, so I can't get rid of the file.

I tried "mkdir /tmp/zzz; mount -F lofs / /tmp/zzz", but when I go to "/tmp/zzz/var", I see the "/var" dataset, not the underlying "root" dataset. That is, the LOFS is crossing mountpoints. I would usually like it, but not this time!.

Any suggestion, beside rebooting the machine in "failsafe" and mess with it thru the IP KVM?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

An old-school trick is to export the filesystem underneath via NFS (I see you tried a similar thing with lofs, slightly surprised at the result so I make no guarantees that it would work in your case of the filesystem being ZFS.)

share|improve this answer
1  
Good suggestion!. Too late to solve my immediate problem, but it should work. I know positively that NFS doesn't cross mount points. –  jcea May 19 '10 at 18:12
    
I had the same issue with OTHER server.The NFS trick works if you export it via "share" instead of "zfs sharenfs", and if you import it especifying version 3. Version 4 does strange things with mountpoints, and doesn't work. I haven't experimented more. –  jcea Sep 30 '10 at 0:39
    
Next problem, enable "root" access. To do so, export like "share -F nfs -o rw,root=127.0.0.1,anon=0 /". When done, stop the share with "unmount" and "unshare /". –  jcea Sep 30 '10 at 0:52

I just rebooted the machine in single user mode. Seems not to be any other way.

Thanks.

share|improve this answer

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.