User Tools

Site Tools


public:techstuff:raid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:techstuff:raid [2012/08/21 14:20] – external edit 127.0.0.1public:techstuff:raid [2020/04/25 13:05] (current) – external edit 127.0.0.1
Line 43: Line 43:
  
 ===== Optimizing the Filesystem ===== ===== Optimizing the Filesystem =====
 +
 +Note: this only applies to striping such as raid 0, 5, 6.
  
 To ensure maximum speeds from the array do the following. To ensure maximum speeds from the array do the following.
Line 54: Line 56:
   sudo mdadm --detail <raid device>   sudo mdadm --detail <raid device>
  
-  * Next visit [[http://busybox.net/~aldot/mkfs_stride.html|this]] website and enter the above details+  * https://gryzli.info/2015/02/26/calculating-filesystem-stride_size-and-stripe_width-for-best-performance-under-raid/ 
 +    * Stride size = [RAID chunk size/ [Filesystem block size] 
 +    * Stripe width = [ Stride size ] * [ Number of data-bearing disks]
  
-  * Finally run the command the website presents. This will only effect future writes to the filesystem.+  sudo tune2fs -E stride=128,stripe_width=512 /dev/mapper/zoidberg-stuff
  
 ===== Adding drive to Raid Array with GPT Partiton ===== ===== Adding drive to Raid Array with GPT Partiton =====
Line 64: Line 68:
 <code> <code>
 $ parted /dev/sdx $ parted /dev/sdx
-(parted) mkpart primary 0 2+(parted) mklabel gpt 
 +(parted) mkpart primary 1049KB 3146KB
 (parted) set 1 bios_grub on (parted) set 1 bios_grub on
-(parted) mkpart primary 3 2000399+(parted) mkpart primary 3146kB 2000GB
 (parted) print free                                                     (parted) print free                                                    
 Model: ATA WDC WD20EARX-00Z (scsi) Model: ATA WDC WD20EARX-00Z (scsi)
Line 83: Line 88:
  
 <code> <code>
-$ grub-install /dev/sdx+$ grub-install --recheck /dev/sdx
 Installation finished. No error reported. Installation finished. No error reported.
 </code> </code>
Line 209: Line 214:
  
   grub-setup --verbose --directory=/boot/grub --device-map=/boot/grub/device.map /dev/sda   grub-setup --verbose --directory=/boot/grub --device-map=/boot/grub/device.map /dev/sda
 +
 +==== Speed up rebuid ====
 +
 +  * Increase the target sync speed when the array is in use.<code>sudo sysctl -w dev.raid.speed_limit_min=50000</code>
 +
 +  * Increase the read ahead.<code>sudo blockdev --setra 65536 /dev/md1</code>
 +
 +  * Increase the cache size to 32MiB<code>sudo bash -c 'echo 32768 > /sys/block/md1/md/stripe_cache_size'</code>
 +
 +==== Bugs ====
 +
 +  * When resizing some arrays you may get <code>[ 4780.580972] md/raid:md0: reshape: not enough stripes.  Needed 512
 +[ 4780.597961] md: couldn't update array info. -28</code> in which case run <code>echo 600 > /sys/block/md0/md/stripe_cache_size</code>
public/techstuff/raid.1345558822.txt.gz · Last modified: 2020/04/25 13:05 (external edit)