Editing
Raid
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Software matige RAID = Configureer de Raid voor de dom0 tijdens de installatie van de fysieke host. Een een softwarematige RAID bestaat op een dom0 uit meerdere md-devices. De fysieke host zelf bevat nauwelijks data en staat op de eerste partities die buiten de raid staan. In eerste instantie zijn twee disks aanwezig, later in een volgende stap van de migratie komen daar twee disks bij.<br/> Op de fysieke host zijn lvm volumes aanwezig: * kvm-root * kvm-data * kvm-swap kvm-root en kvm-data staan in volume groups met elk een eigen raid device. kvm-swap staat in een volume group die bestaat uit gewone partities. == Volumes op een software raid == Na de installatie van nuttige software: root@host:~# apt-get install mdadm raidutils array-info lvm2 Configuratie van een nieuw md-device: <pre> root@host:~# mdadm -v --create /dev/md0 --level=raid5 --raid-devices=2 /dev/sda3 /dev/sdb3 root@host:~# mdadm -v --create /dev/md1 --level=raid5 --raid-devices=2 /dev/sda4 /dev/sdb4 root@host:~# watch cat /proc/mdstat </pre> Volg het proces met: root@host:~# watch cat /proc/mdstat == Verwisselen van een schijf == Een partitie die uit een raid is gevallen krijgt de status failed. Je moet de schijf zo snel mogelijk vervangen, omdat de gehele raid verloren is als er nog een partitie in dezelfde raid kapot gaat. <pre> root@host:~# mdadm --remove /dev/md1 /dev/sdd4 root@host:~# mdadm --remove /dev/md0 /dev/sdd3 </pre> Na het plaatsen van de nieuwe kopieer je eerst de partitie tabel van een andere schijf uit de raid, om daarna de patities weer aan de raid toe te voegen. <pre> root@host:~# mdadm --add /dev/md0 /dev/sdd3 root@host:~# mdadm --add /dev/md1 /dev/sdd4 </pre> Het operating system verzorgt automatisch een rebuild van de raid array. = Toevoegen drives = Voeg aan een bestaande raid5 configuratie met twee drives twee extra drives toe. Dit gaat in stappen: * Kopieer de partitie tabel van de tweed drive naar drives drie en vier * Voeg de relevante partities van beide drives als spare toe * Breid het aantal devices van de array uit * Breid het physical volume van de array uit == Kopieer partities over volgende drives == De beste manier om identieke partities op raid devices te maken is het kopieren van de partitie tabel over de volgende disk heen: root@host:~# sfdisk -d /dev/sda | sfdisk /dev/sdb Dit gaat niet altijd zonder slag of stoot, zeker als je drives van verschillende merken in de array hebt. In dat geval is het noodzakelijk om de partitietabel handmatig toe te voegen.<br> Een ander mogelijkheid is het aanmaken van een bestand partition.txt. <pre> root@host:~# sfdisk -d /dev/sda > partition.txt root@host:~# sfdisk /dev/sdb < partition.txt </pre> == Uitbreiden van de array == Het uitbreiden van de array gaat door eerst spares toe te voegen en daarna de array met de spares uit te breiden <pre> root@host:~# mdadm -a /dev/md0 /dev/sdc3 /dev/sdd3 root@host:~# mdadm -a /dev/md1 /dev/sdc4 /dev/sdd4 root@host:~# mdadm --grow --raid-devices=4 /dev/md0 root@host:~# mdadm --grow --raid-devices=4 /dev/md1 </pre> Volg het proces met watch cat /proc/mdstat Aan het einde van het proces laat de array de nieuwe omvang zien met <pre> root@host:~# mdadm --detail /dev/md0 /dev/md0: Array Size : 37722624 (35.98 GiB 38.63 GB) Used Dev Size : 12574208 (11.99 GiB 12.88 GB) Raid Devices : 4 Number Major Minor RaidDevice State 0 8 3 0 active sync /dev/sda3 2 8 19 1 active sync /dev/sdb3 3 8 35 2 active sync /dev/sdc3 4 8 51 3 active sync /dev/sdd3 root@host:~# mdadm --detail /dev/md1 /dev/md1: Array Size : 668891136 (637.90 GiB 684.94 GB) Used Dev Size : 222963712 (212.63 GiB 228.31 GB) Raid Devices : 4 Number Major Minor RaidDevice State 0 8 4 0 active sync /dev/sda4 2 8 20 1 active sync /dev/sdb4 3 8 36 2 active sync /dev/sdc4 4 8 52 3 active sync /dev/sdd4 </pre> Of met: <pre> root@host:~# array-info -a -d /dev/md0 MD Linux driver Version 1.2.3 Creation time : Sat Apr 2 17:19:25 2557 Fault tolerance : RAID 5 Array Size : 35.98 GiB Status : Logical drive is ok Devices : 4 Size : 11.99 GiB Raid : 4 Active : 4 Working : 4 Failed : 0 Spare : 0 RaidDevice State 0 active synchronized -1 removed 1 active synchronized 2 active synchronized root@host:/etc/mdadm# array-info -a -d /dev/md1 MD Linux driver Version 1.2.3 Creation time : Sat Apr 2 17:20:06 2557 Fault tolerance : RAID 5 Array Size : 637.90 GiB Status : Logical drive is ok Devices : 4 Size : 212.63 GiB Raid : 4 Active : 4 Working : 4 Failed : 0 Spare : 0 RaidDevice State 0 active synchronized -1 removed 1 active synchronized 3 active synchronized root@host:/etc/mdadm# </pre> == Extra ruimte array toekennen == De nieuwe extra ruimte is nog niet beschikbaar voor het physical volume op de array, toekennen gaat met pvresize. <pre> root@host:~# pvscan PV /dev/sdc5 VG kvm-swap lvm2 [8.00 GiB / 7.12 GiB free] PV /dev/md1 VG kvm-data lvm2 [212.63 GiB / 198.63 GiB free] PV /dev/md0 VG kvm-root lvm2 [11.99 GiB / 3.99 GiB free] Total: 3 [232.62 GiB] / in use: 3 [232.62 GiB] / in no VG: 0 [0 ] root@host:~# pvresize /dev/md0 Physical volume "/dev/md0" changed 1 physical volume(s) resized / 0 physical volume(s) not resized root@host:~# pvresize /dev/md1 root@host:~# mdadm --detail /dev/md1 Physical volume "/dev/md1" changed 1 physical volume(s) resized / 0 physical volume(s) not resized root@host:~# pvscan PV /dev/sdc5 VG kvm-swap lvm2 [8.00 GiB / 7.12 GiB free] PV /dev/md1 VG kvm-data lvm2 [637.90 GiB / 623.90 GiB free] PV /dev/md0 VG kvm-root lvm2 [35.97 GiB / 27.97 GiB free] Total: 3 [681.87 GiB] / in use: 3 [681.87 GiB] / in no VG: 0 [0 ] root@host:~# </pre> <hr> Terug naar: [[Webhuis bouwstenen]]
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information