This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
deb9:mdadm [2021/12/05 12:41] – [Raid 1, 5, 6] Bernard Condrau | deb9:mdadm [2024/04/03 15:08] (current) – [Links] Bernard Condrau | ||
---|---|---|---|
Line 34: | Line 34: | ||
| sdh | sdh1 | | sdh | sdh1 | ||
- | see also [[deb720:apsys|Hardware configuration]] | + | see also [[hw:machines# |
==== Replace a failed RAID disk ==== | ==== Replace a failed RAID disk ==== | ||
Line 91: | Line 91: | ||
* Default system values on Debian 10:< | * Default system values on Debian 10:< | ||
dev.raid.speed_limit_max = 200, | dev.raid.speed_limit_max = 200, | ||
- | * Set to 32 MB for my raids (2021-12-05):< | + | * Reduce max limit to make server more responsive during resync |
sudo sysctl -w dev.raid.speed_limit_max=100, | sudo sysctl -w dev.raid.speed_limit_max=100, | ||
=== read-ahead === | === read-ahead === | ||
* Get current read-ahead (in 512-byte sectors) per Raid device (default value is 512 on Debian 10):< | * Get current read-ahead (in 512-byte sectors) per Raid device (default value is 512 on Debian 10):< | ||
- | * Set to the following values for my raids (2021-12-05):< | + | * Set to 32 MB:< |
+ | * Set to 65536 on a server with 32GB memory, 32768 on a server with 8GB memory (2021-12-05) | ||
=== Disable NCQ === | === Disable NCQ === | ||
Line 104: | Line 105: | ||
==== Raid 5, 6 only ==== | ==== Raid 5, 6 only ==== | ||
=== stripe_cache_size === | === stripe_cache_size === | ||
- | It records the size (in pages per device) of the stripe cache which is used for synchronising all write operations to the array and all read operations if the array is degraded. The default is 256 which equals to 3MB memory consumption. Valid values are 17 to 32768. Make sure your system has enough memory available: memory_consumed = system_page_size * nr_disks * stripe_cache_size. | + | It records the size (in pages per device) of the stripe cache which is used for synchronising all write operations to the array and all read operations if the array is degraded. The default is 256 which equals to 3MB memory consumption. |
* Find system page size, on Debian 10 this is 4096:< | * Find system page size, on Debian 10 this is 4096:< | ||
- | * Set to 384MB memory consumption on a 3 disk Raid:< | + | * Set to 384MB memory consumption on a 3 disk:< |
+ | * Set to 32768 on a server with 32 GB memory, set to 16384 on a server with 8 GB memory (2021-12-05) | ||
+ | |||
+ | ===== Prepare RAID with single disk ===== | ||
+ | ==== Prepare new disk ==== | ||
+ | - If the new disk contains partitions | ||
+ | - Stop any Raid partitions with< | ||
+ | mdadm --remove / | ||
+ | - Remove the superblocks< | ||
+ | - Remove existing partitions with '' | ||
+ | - Create a new partition utilizing the full disk space. When asked, remove the existing signature. Change partition type to '' | ||
+ | Command (m for help): d | ||
+ | Command (m for help): n | ||
+ | Command (m for help): t, | ||
+ | - Create the RAID< | ||
+ | - Check the RAID was created< | ||
+ | ls / | ||
+ | ==== Links ==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
===== Move RAID to a new machine ===== | ===== Move RAID to a new machine ===== | ||
Line 114: | Line 135: | ||
- Append info to mdadm.conf< | - Append info to mdadm.conf< | ||
- Update initramfs< | - Update initramfs< | ||
+ | - Copy entire disk to new RAID (add '' | ||
+ | - Check size of directory< | ||
==== Troubleshooting ==== | ==== Troubleshooting ==== | ||
Line 123: | Line 146: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
===== Links ===== | ===== Links ===== | ||
* [[https:// | * [[https:// |