Failed to import any pool on this device(2). Error: Error running a command. cmd

[Please complete the below template with details of the problem reported on your Web-UI. Be as detailed as possible. Community members, including developers, shall try and help. Thanks for your time in reporting this issue! We recommend purchasing commercial support for expedited support directly from the developers.]

Brief description of the problem

        Traceback (most recent call last):

File “/opt/rockstor/src/rockstor/storageadmin/views/disk.py”, line 704, in _btrfs_disk_import
enable_quota(po)
File “/opt/rockstor/src/rockstor/fs/btrfs.py”, line 663, in enable_quota
return switch_quota(pool)
File “/opt/rockstor/src/rockstor/fs/btrfs.py”, line 659, in switch_quota
return run_command(cmd)
File “/opt/rockstor/src/rockstor/system/osi.py”, line 115, in run_command
raise CommandException(cmd, out, err, rc)
CommandException: Error running a command. cmd = /sbin/btrfs quota enable /mnt2/thomas_nas. rc = 1. stdout = [’’]. stderr = [‘ERROR: quota command failed: Read-only file system’, ‘’]

Detailed step by step instructions to reproduce the problem

Houston, we’ve had a problem.
Failed to import any pool on this device(2). Error: Error running a command. cmd = /sbin/btrfs quota enable /mnt2/thomas_nas. rc = 1. stdout = [’’]. stderr = [‘ERROR: quota command failed: Read-only file system’, ‘’]

        Traceback (most recent call last):

File “/opt/rockstor/src/rockstor/storageadmin/views/disk.py”, line 704, in _btrfs_disk_import
enable_quota(po)
File “/opt/rockstor/src/rockstor/fs/btrfs.py”, line 663, in enable_quota
return switch_quota(pool)
File “/opt/rockstor/src/rockstor/fs/btrfs.py”, line 659, in switch_quota
return run_command(cmd)
File “/opt/rockstor/src/rockstor/system/osi.py”, line 115, in run_command
raise CommandException(cmd, out, err, rc)
CommandException: Error running a command. cmd = /sbin/btrfs quota enable /mnt2/thomas_nas. rc = 1. stdout = [’’]. stderr = [‘ERROR: quota command failed: Read-only file system’, ‘’]

Web-UI screenshot

[Drag and drop the image here]

Error Traceback provided on the Web-UI

[paste here]

@Thomas_Kluge Welcome to the Rockstor community.

The issue here appears to be that your pool is read only and is then throwing Rockstor code which, for the version you are running, assumes a rw mount is possible.

Note that as from Rockstor version 3.9.2-15 in the stable release channel a fix for what looks like your issue was added as part of the following pull request:

ie “Fix import failure (prior TODO:) via Read-only quota enable attempt on import.”

and the entire pull request was to address the following issue:
https://github.com/rockstor/rockstor-core/issues/1890

where it’s later text states:

“Failed to import any pool on this device(2). Error: Error running a command. cmd = /sbin/btrfs quota enable /mnt2/genepool. rc = 1. stdout = [’’]. stderr = [‘ERROR: quota command failed: Read-only file system’, ‘’]”

So it looks like you may be on the now older testing channel updates.

What version of Rockstor are you attempting this import with?

The read only status of your pool / volume / file-system could be due to an outstanding problem with it’s integrity. Btrfs will often go read only if it encounters any issues or there are anomalies.

And has this pool been used with Rockstor before?

The output of (run on a local terminal as the root user):

btrfs fi show

and given a read only mount was achieved (at /mnt2/thomas_nas for the pool) you may get some info errors to date, which includes ones that have been fixed since the last stats counter reset, via the following command:

btrfs dev stats /mnt2/thomas_nas

assuming you have just attempted an import as above.

Irrespective, given Rockstor’s Web-UI currently has few btrfs repair procedures ‘build in’ your best bet is to first fix the pool so that it can be mounted rw: assuming you did not manually mount it as read only. But given it can currently be mounted read only you may want to retrieve what data you can prior to attempting anything, if that data is the only copy you have.

A good guide on repairing btrfs volumes is in the:

“How to repair a broken/unmountable btrfs filesystem” subsection of openSUSE’s Support Data Base: page:

https://en.opensuse.org/SDB:BTRFS

Mount points and system subvols are all different (for the time being as we are planning to move to openSUSE as a mid term project) but the repair advise is very good and the above commands should give you your device names: but note that they can change from one boot to another, most especially if a power cycle has happened.

Hope that helps; and the output of those commands should help others help you in this scenario. Also not that Rockstor is improving all the time so updating to the newest version for your chosen update channel should only help.

In short, the pool should have been mounted read write but was found to be read only after the mount attempt, which if initially done by Rockstor would have initially been a read write mount attempt. And if you were to update to the stable channel the import may succeed, given the numerous fixes / improvements in that code. But the core issue of why the pool is read only will not be affected and so you will still have to resolve that element and in either case it will have to be done via the command line.