Jump to content

Drive Pool In Read Only After Adding Drive and Changing to RAID 0


jdiacobbo
Go to solution Solved by JorgeB,

Recommended Posts

Posted (edited)

I recently added a new drive to a drive pool and changed the type to RAID 0. Initially it seemed to work fine but once the rebalance finished the pool became read only. Scrubs also abort instantly with error -30. I m seeing a bunch of errors in the logs related to brtfs as well. Any Ideas what's going on? 

 

Edited by jdiacobbo
Typo in Subject
  • Solution
Posted

The balance never finished since it ran out of space, note that raid0 with two different capacity disks will only use the space from the smallest one on both, single profile will fully use both.

  • Like 1
Posted
4 hours ago, JorgeB said:

The balance never finished since it ran out of space, note that raid0 with two different capacity disks will only use the space from the smallest one on both, single profile will fully use both.

Good to know. I was using this link from the Storage Management docs which made it seem like I would be able to use the full amount of storage on the drives.

image.thumb.png.f2f06472886caccdb4afcf408d3ced71.png

 

Additionally this info from the Balance section in the pool config also led me to believe that I would have more storage than the single drive.

image.thumb.png.2b1aa2c6f546d6b56c36bafd0c70acd4.png

 

I guess I just misunderstood what was happening.

 

So are you saying I can have multiple drives in a pool and set it to single mode? When setting the pool to single, how is the data distributed between the two disks? 

  • jdiacobbo changed the title to Drive Pool In Read Only After Adding Drive and Changing to RAID 0
Posted
1 hour ago, jdiacobbo said:

which made it seem like I would be able to use the full amount of storage on the drives.

This may have changed for newer kernels, I seem to remember reading something about that, but have not tested yet, but with the one you are using, it won't fully use both disks.

 

1 hour ago, jdiacobbo said:

So are you saying I can have multiple drives in a pool and set it to single mode?

Correct.

 

1 hour ago, jdiacobbo said:

When setting the pool to single, how is the data distributed between the two disks? 

It will start writing to the drive with most free space, once they are both the same, it will alternate between the two for any new chunks, these are 1GiB in size.

 

 

  • Like 1
Posted (edited)
On 9/21/2024 at 9:27 AM, JorgeB said:

This may have changed for newer kernels, I seem to remember reading something about that, but have not tested yet, but with the one you are using, it won't fully use both disks.

 

Correct.

 

It will start writing to the drive with most free space, once they are both the same, it will alternate between the two for any new chunks, these are 1GiB in size.

 

 

Thanks for the info. So at this point how do I go about correcting this? I tried to use the balancer to change back to Single mode but it doesn't appear to be doing anything.

 

Edited by jdiacobbo
Posted

It may not be possible, since I'm seeing other issues with the filesystem, and you are using encrypton which complicates things by a lot, but try this:

 

-disable array auto-start if enabled

-reboot to clear the logs

-check that the pool device identifiers didn't change, and if yes, type in the CLI (you will need to enter the encryption passphrase when asked)

cryptsetup luksOpen /dev/sdn1 sdn1 --allow-discards
cryptsetup luksOpen /dev/sdj1 sdj1 --allow-discards

mkdir /x
mount -t btrfs -o skip_balance /dev/mapper/sdj1 /x
btrfs balance cancel /x
umount /x

/usr/sbin/cryptsetup luksClose sdj1
/usr/sbin/cryptsetup luksClose sdn1

 

Then start the array normally and post new diags.

Posted

Before I do anything further I want to back up the data to the array. Curiously everywhere I look, the pool capacity is listed at different values. The GUI lists it at 22TB, the btrfs Balance status at 17.46TiB, and the unBalance plugin somewhere around 7.8 TB. Is there any risk of data loss here or should it all still be available just read only?

 

image.thumb.png.63695abf45484df9a9315d564362b958.png

 

image.thumb.png.3616e6d790ab2eb05882280b88d1c4fc.png

Posted (edited)
On 9/22/2024 at 5:36 AM, JorgeB said:

It may not be possible, since I'm seeing other issues with the filesystem, and you are using encrypton which complicates things by a lot, but try this:

 

-disable array auto-start if enabled

-reboot to clear the logs

-check that the pool device identifiers didn't change, and if yes, type in the CLI (you will need to enter the encryption passphrase when asked)

cryptsetup luksOpen /dev/sdn1 sdn1 --allow-discards
cryptsetup luksOpen /dev/sdj1 sdj1 --allow-discards

mkdir /x
mount -t btrfs -o skip_balance /dev/mapper/sdj1 /x
btrfs balance cancel /x
umount /x

/usr/sbin/cryptsetup luksClose sdj1
/usr/sbin/cryptsetup luksClose sdn1

 

Then start the array normally and post new diags.

I had some odd behavior so I needed to reboot. I'm not 100% how to check if the pool identifiers changed but everything came up as I would expect. Let me know if this looks right?

Edited by jdiacobbo
Posted
4 hours ago, JorgeB said:

That's only the allocated size, not total capacity, stats are more clear on v7.

 

Pool is still using sdj and sdn

 

 

Any thought on reverting it back to single mode in place or is a copy and reformat the only option?

Posted

i tried canceling the balance but it says there isn't  balance running and the pool is read only so I can't delete anything. At this point I'm just going to copy the data over to the array and reformat it.

Posted

Rebooted and ran the commands you posted previously. The pool was writable and I'm now able to select Convert to single in the Balance Status section and its running. We'll see if this works! At this point this is just for educational purposes. I think I'll end up just adding the drives to the array as encrypted drives and setting a share exclusive to those drives which would accomplish the same end result. That would make more sense and probably be easier long term than using a pool. Thanks for all the help @JorgeB!

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...