Solved A potential problem with a pool?

Greetings all,

I have rebooted a server and my storage pool was not mounted. zpool import showed the pool, but zpool import storage resulted in
Code:
cannot mount '/storage': directory is not empty
cannot mount '/storage/filesystem': directory is not empty
Another zpool export storage and zpool import storage resulted no response and zpool import in
Code:
no pool svailable to import

Another reboot restored the pool. Although I have a backup, I am wondering if I have an underlying problem. Can anyone comment?

Kindest regards,

M
 
Before you attempt the ZFS import (which is de-facto a mount), what is in /storage? Mount points should be empty before mounting.

(When I say "should", I mean: for most file systems, that is a best practice, but not a hard rule. Mounting over existing content is a really bad idea, because that content temporarily vanishes, and then suddenly reappears. ZFS happens to enforce this best practice.)
 
Hi ralphbsz,

thank you for the answer, though I do not understand it at all. The pool had been exported and imported with the same structure several times before.

I have reviewed zpool(8) and have not found any instructions regarding need for a special preparation before export. Could you please amplify, how am I to assure that the /storage is empty before export so that it does import properly?

Kindest regards,

M
 
I think ralphbsz means:

Before you do zpool import storage, what is the output of the following
mount | grep -i storage grep -i storage /etc/fstab

Double check that the mountpoint of /storage is not already in use by something else, because that is what the error messages are implying.
 
Hi mer,

thank you for the clarification and I will, of course, do so, as I do not want any surprises like that in the future.

However, the reason I asked the question was, that I had no problems before, and there have been no other /storage defined/created anywhere.

The structure of the pool is (simplified):
Code:
NAME            MOUNTPOINT
storage            /storage

So, if I simply export the pool, do not create any /storage directory, and import the pool, how can the /storage directory (now mountpoint) not be empty?

Kindest regards,

M
 
Before mounting the ZFS pool, do "ls -a /storage". It should show that the directory exists (to be used as a mount point), and is empty. If you find things in there, figure out where they came from, whether you need them, and where to put them.
 
Hi ralphbsz,

Thank you for the clarification. I will do so, as per my reply to mer. But, the bigger question, how could this happen remains. Hence my worry regarding some other problem.

Kindest regards,

M
 
I'm trying to figure it out. So your zpool mountpoint is /storage, I think as ralphbsz says at somepoint a "mkdir /storage" was done. Maybe automatically, maybe as part of "importing a pool for the first time".
That means you physically have a directory at /storage, even when your pool is not imported. At that point if you have done zpool export storage, the pool is not mounted anywhere, the directory exists and you could "cp -v /root/* /storage" and put stuff in the directory named /storage.
I can imagine that happening if you thought the pool was imported but was not. I've done it myself.

So zpool export storage, use the mount or other commands to make sure the pool and all subpools are not mounted anywhere and go do the ls -a /storage to see if there is anything there.
When one is experimenting and trying different things, it's easy to lose track of where you are. I've done it, I'd bet a cup of coffee or mug of beer that ralphbsz has done. It happens.
 
Hi mer,

thank you very much for your attempt to figure it out.

I am, by no means claiming that I am perfect and I do not make mistakes. In fact, as I am currently unifying my backup(s) scattered over several datasets on two different servers, I was wondering why files in the source directory that I knew were in the target directory were being transferred, until I realized, that UNIX is case sensitive and the source directory, which is a Windows backup, had a leading capital letter in the, otherwise same, name of the directory being synchronized.

However, in the above described case, I am certain I did not make a mistake because I had specifically exported the pool storage, not to make a mistake when making some changes to the system pool. And there was no /storage on the root pool, that was the first think I checked upoon the failed import. Hence my panic and worry that there might be some other issue.

I had run scrub on the storage pool and it came clean. I am now synchronizing the backup files from the pool. Once it is done I will destroy the pool and re-build it with larger or additional drives, so perhaps I will not have to worry about it. So, I just mark the thread solved.

Kindest regards,

M
 
  • Like
Reactions: mer
Hi Erichans,

Not a panacea but zpool-history(8) can certainly be helpful: zpool history <poolname>
Thank you for the command. Unfortunately, running it, again raised my paranoia because:

Code:
2022-07-29.9:12:47 zpool export storage
2022-07-29.9:15:05 zfs set sharenfs=on storage/dataset_01

So, the command shows exported pool on which I am setting a property? Maybe, there is something wrong with my pool after all.

Kindest regards,

M
 
Back
Top