Jump to content

SSD RAID1


craigr

Recommended Posts

On 4/24/2016 at 3:13 AM, JorgeB said:

Can I manually create and use multiple btrfs pools?

 

Work in progress.

 

Multiple cache pools are not supported yet, though they are planned for the future, until then you can still use multiple btrfs pools with the help of the Unassigned Devices plugin.

 

There are some limitations and most operations creating and maintaining the pool will need to be made using the command line, so if you're not comfortable with that wait for LT to add the feature.

 

If you want to use the now, here's how:

 

-If you don't have yet install the Unassigned Devices plugin.

-Better to start with clean/wiped devices, so wipe them or delete any existing partitions.

-Using UD format the 1st device using btrfs, choose the mount point name and optionally activate auto mount and share

-Using UD mount the 1st device, for this example it will be mounted at /mnt/disks/yourpoolpath

-Using UD format the 2nd device using btrfs, no need to change the mount point name, and leave auto mount and share disable.

-Now on the console/SSH add the device to the pool by typing:


btrfs dev add -f /dev/sdX1 /mnt/disks/yourpoolpath

     Replace X with correct identifier, note the 1 in the end to specify the partition (for NVMe devices add p1, e.g. /dev/nvme0n1p1)

 

-Device will be added and you will see the extra space on the 1st disk free space graph, whole pool will be accessible in the original mount point, in this example:

/mnt/disks/yourpoolpath

-By default the disk is added in single profile mode, i.e., it will extend the existing volume, you can change that to other profiles, like raid0, raid1, etc, e.g., to change to raid1 type:


btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/disks/yourpoolpath

     See here for the other available modes.

 

-If you want to add more devices to that pool just repeat the process above

 

Notes

 

-Only mount the first device with UD, all other members will mount together despite nothing being shown on UD's GUI, same to unmount, just unmount the 1st device to unmount the pool.

-It appears that if you mount the pool using the 1st device used/free space are correctly reported by UD, unlike if you mount using e.g. the 2nd device, still for some configurations the space might be incorrectly reported, you can always check it using the command line:


btrfs fi usage /mnt/disks/yourpoolpath

-You can have as many unassigned pools as you want, example how it looks on UD:

 

udpools.thumb.png.3c48824549c282ccf6562716e6736ff9.png

 

sdb+sdc+sdd+sde are part of a raid5 pool, sdf+sdg are part of raid1 pool, sdh+sdi+sdn+sdo+sdp are another raid5 pool, note that UD sorts the devices by identifier (sdX), so if sdp was part of the first pool it would still appear last, UD doesn't reorder the devices based on if they are part of a specific pool.

 

You can also see some of the limitations, i.e., no temperature is shown for the secondary pools members, though you can see temps for all devices on the dashboard page, still it allows to easily use multiple pools until LT adds multiple cache pools to Unraid.

 

Remove a device:

-to remove a device from a pool type (assuming there's enough free space):


btrfs dev del /dev/sdX1 /mnt/disks/yourpoolpath 

     Replace X with correct identifier, note the 1 in the end

 

Note that you can't go below the used profile minimum number of devices, i.e., you can't remove a device from a 2 device raid1 pool, you can convert it to single profile first and then remove the device, to convert to single use:


btrfs balance start -f -dconvert=single -mconvert=single /mnt/disks/yourpoolpath

Then remove the device normally like above.

 

Replace a device:

To replace a device from a pool (if you have enough ports to have both old and new devices connected simultaneously):

 

You need to partition the new device, to do that format it using the UD plugin, you can use any filesystem, then type:


btrfs replace start -f /dev/sdX1 /dev/sdY1 /mnt/disks/yourpoolpath

 

Replace X with source, Y with target, note the 1 in the end of both, you can check replacement progress with:


btrfs replace status /mnt/disks/yourpoolpath

 

If the new device is larger you need to resize it to use all available capacity, you can do that with:


btrfs fi resize X:max /mnt/disks/yourpoolpath

Replace X with the correct devid, you can find that with:


btrfs fi show /mnt/disks/yourpoolpath

 

 

Screenshot 2018-03-18 14.42.51.png

I am thinking of setting up two 1TB Samsung 850 PRO SATA SSD drives in RAID1.  I was thinking that it might be best to do this with the motherboard RAID controller.  Is there any reason that this method would be better?  I guess that one good thing would be that I could change mainboards in the future and not have to rebuild the RAID1 array?

 

Thanks for any advice,

craigr

Link to comment

Split your question here since the FAQ thread is reserved for that.

 

You should avoid RAID controllers with Unraid, it might not even work with Linux if it's a "fake" RAID controller, also note that the new beta supports multiple pools, I encourage to use that instead, though I'll leave that FAQ entry up until v6.9 goes stable.

Link to comment
13 hours ago, JorgeB said:

Split your question here since the FAQ thread is reserved for that.

 

You should avoid RAID controllers with Unraid, it might not even work with Linux if it's a "fake" RAID controller, also note that the new beta supports multiple pools, I encourage to use that instead, though I'll leave that FAQ entry up until v6.9 goes stable.

Sorry about the post in the FAQ.  I realized what I had done when my post was gone. 

 

Thank you for your answer.

 

It sounds like I should probably just upgrade to 6.9 beta.  I'll do some research and make sure it'll work for me, but it's not like it is difficult to backdate if necessary.

 

Kind regards,

craigr

Link to comment

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...