How to delete a Pool & Share if the Pool has failed and cannot be mounted

The following might be different for anyone else but this was my experience in deleting a failed pool & share that would not remove from Web-U. Please be careful if you have data and things are behaving, you will lose more than you’d want to! This is only for those who have failed hardware situations and are trying to purge the old configs from clogging up their system! I figured I’d share my findings with everyone, though I’m certain someone out there has done something similar to what I did.

Ok so I had a raid 5 volume implode (3 disk out of 5 failure) and just replaced all of the drives as they were aging/dead/waste of energy.
I replaced all of the drives with new ones & created a new raid volume using my internal hardware controller. Once that completed (about 12 hours) I began the task of recreating the pool.

Sadly though I could not reuse the old poolname or sharename, and I really want/need to reuse it. I I had some freetime & started digging.

So I attempted to delete the pool & it failed as it could not mount the disk. (I should have stopped right here!)
Trying to delete the share failed, because there were active exports in NFS, so I delete the export, tried again to delete the share, forgot there was also a samba share. Deleted the samba share…hmmm ok done. Still couldn’t delete the volume share or the pool…

It spits out the typical python traceback errors. Ok so in the traceback I noticed that it could not mount /mnt2/mypoolname because there was no /dev/disk/by-label/mypoolname. Hmm ok, I try the typical thing of chattr -i /mnt2/mypoolname & mysharename but no dice of course because there is no physical volume assigned to that mount any longer.

Ok so lets slice this up with an “Occams Razor” (ugh sorry bad pun!). I bet I can do something really dumb & simple to fix it and it will work perfectly.

cd /dev/disk/by-label
ls -al
rockstor_rockstor -> …/…/sda3

LOL ok symlink to a simple persistent block device in the /dev tree, sweet this should be easy!

[root@host14278940 by-label]# pwd

mkdir -p myvolname/mysharename

cd /mnt2
chattr -i /mnt2/mypoolname
chattr -i /mnt2/mysharename

In Web-UI deleted share & pool, then on cmd line:

rm -rf /mnt2/mypoolname /mnt2/mysharename

Problem solved.

1 Like

hi, im unable to delete in web-ui, error mount is not a block device