This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
start:isbtrfsok [2022/10/23 22:27] – admin | start:isbtrfsok [2024/01/24 19:49] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | BTRFS is working well at the moment on a single disk, or with RAID6 (metadata | + | DATE CHECKED THIS PAGE WAS VALID: 14/09/2023 |
- | Note: For RAID 6 to avoid loss of data/ | + | |
- | eg imagine 6 disks the command to create the array is: | + | BTRFS is working well at the moment on a single disk, or with RAID1C3 |
mkfs.btrfs -L myraidlabel -m raid1c3 -d raid6 -f < | mkfs.btrfs -L myraidlabel -m raid1c3 -d raid6 -f < | ||
+ | |||
+ | However as RAID6 is not considered 100% safe yet its better to do something like: | ||
+ | |||
+ | mkfs.btrfs -L myraidlabel -m raid1c3 -d raid1c3 -f < | ||
This command destroys whats on the disks (-f was used = force creation). | This command destroys whats on the disks (-f was used = force creation). | ||
- | Advantage of this is metadata is normally small while raid 6 gives the space and speed benefits for the data written. | + | Advantage of the first command |
- | Once you have more than 16 disks or 24TB across the disks RAID 5/6 is no longer considered safe due to URE so you should use only 1c4 for metadata and data. You can only use 25% of total disk space though of all drives. Some companies use Raid 10 which is 50% of the disk space with an even number of disks but inly 1 disk failure is safe in each mirrorrd leg so I personally dont use it. ZFS might be a better choice at this number of disks or more though so best do your research here… | + | Once you have more than 12 disks or 24TB across the disks RAID 6 is no longer considered |
Dont forget you can convert raid by balance eg: | Dont forget you can convert raid by balance eg: | ||
Line 15: | Line 19: | ||
If the array is already created, you can convert to 1c3 or whatever with btrfs balance start -mconvert=raid1c3 / | If the array is already created, you can convert to 1c3 or whatever with btrfs balance start -mconvert=raid1c3 / | ||
- | -mconvert=... converts metadata while -dconvert=... converts data, and you can provide both at the same time if you want and so on. | + | -mconvert=… converts metadata while -dconvert=… converts data, and you can provide both at the same time if you want and so on. |
+ | A weekly scrub AND balance is suggested in a RAID environment so that self healing and filesystem maintenance is performed. For a single disk just a monthly scrub is fine and you can run it manually or schedule one with cron if you prefer. If there are any corrupt files, it cant self heal anyway so you would be restoring from backup, and balancing on a single disk generally happens automatically to a degree so I normally dont worry about it (only 1 copy of data is kept). | ||
- | A weekly scrub and balance is suggested in a RAID environment so that self healing and filesystem maintenance is performed. | + | For single |
- | For single disks in a home PC I use the following mount options | + | So for example |
- | defaults, | + | |
- | So for example | + | This keeps things nice and tidy and automatically handles trim, and balance. As mentioned there is no self healing on a single disk so you can run a scrub to check for errors every now and again but a backup is needed to restore files. Dont forget to dup metadata even on a single |
- | UUID=383732b1-5e87-4b68-a15a-f044bc559877 / | + | |
- | This keeps things nice and tidy and automatically handles trim, and balance. As mentioned there is no self healing on a single disk so you can run a scrub to check for errors every now and again but a backup | + | Overall BTRFS is production ready now since Linux Kernel 6 onwards. There are a few gotchas but nothing major and if you use RAID1C3/4 data is kept safe. |
- | Overall BTRFS is production ready now since Linux Kernel 6 onwards. | + | Also note: autodefrag |