{"id":1381,"date":"2011-10-12T17:27:36","date_gmt":"2011-10-12T16:27:36","guid":{"rendered":"http:\/\/www.nausicamedia.fr\/blog\/?p=1381"},"modified":"2011-10-12T17:27:36","modified_gmt":"2011-10-12T16:27:36","slug":"script-basique-pour-creer-un-miroir","status":"publish","type":"post","link":"https:\/\/nausicamedia.fr\/blog\/script-basique-pour-creer-un-miroir\/","title":{"rendered":"Script basique pour cr\u00e9er un miroir"},"content":{"rendered":"<p>Migrer un volume sur un disque miroir est souvent la premi\u00e8re chose que vous faites vers un serveur tout frais sorti de sa bo\u00eete. Ce script lit les donn\u00e9es des deux volumes et cr\u00e9e un miroir fond\u00e9 sur ces donn\u00e9es, il est facilement utilisable avec DeployStudio ou une gestion de flux de scripts :<\/p>\n<blockquote><p>#!\/bin\/bash<br \/>\n#Converts a standalone disk to a RAID 1 and automates adding the second member.<br \/>\nclear<br \/>\necho -n \u00ab\u00a0Enter the name of the first volume to be placed in the mirror: \u00a0\u00bb<br \/>\nread disk_1<br \/>\nexport disk_1nv=`echo $disk_1 | sed &lsquo;s:\/Volumes\/::g&rsquo;`<br \/>\necho \u00a0\u00bb<br \/>\ncreating the $disk_1 mirror\u00a0\u00bb<br \/>\nsleep 2<br \/>\nexport disk_1slice=`diskutil list \u00ab\u00a0$disk_1\u00a0\u00bb | grep -m 1 \u00ab\u00a0$disk_1nv\u00a0\u00bb | grep -o \u00ab\u00a0disk&#8230;\u00a0\u00bb`<br \/>\ndiskutil appleRAID enable mirror $disk_1slice<br \/>\necho -n \u00ab\u00a0Enter the name of the second volume to be placed in the mirror: \u00a0\u00bb<br \/>\nread disk_2<br \/>\nexport disk_2nv=`echo $disk_2 | sed &lsquo;s:\/Volumes\/::g&rsquo;`<br \/>\nexport disk_2root=`diskutil list \u00ab\u00a0$disk_2\u00a0\u00bb | grep -m 1 \u00ab\u00a0$disk_2nv\u00a0\u00bb | grep -o \u00ab\u00a0disk.\u00a0\u00bb`<br \/>\nexport raid_uuid=`diskutil info $disk_1slice | grep \u00ab\u00a0Parent RAID Set UUID\u00a0\u00bb | sed -e &lsquo;s_Parent RAID Set UUID:__g;s_^[ t]*__&rsquo;`<br \/>\ndiskutil AppleRAID add member $disk_2root $raid_uuid<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p><em>Cette article a paru sur\u00a0Tech Journal\u00a0de 318, le 12 septembre 2011.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Migrer un volume sur un disque miroir est souvent la premi\u00e8re chose que vous faites vers un serveur tout frais sorti de sa bo\u00eete. Ce script lit les donn\u00e9es des deux volumes et cr\u00e9e un miroir fond\u00e9 sur ces donn\u00e9es, il est facilement utilisable avec DeployStudio ou une gestion de flux de scripts : #!\/bin\/bash [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2],"tags":[57,59,65,68],"class_list":["post-1381","post","type-post","status-publish","format-standard","hentry","category-solution-apple","tag-raid","tag-sauvegarde","tag-stockage","tag-sysadmin"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/posts\/1381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/comments?post=1381"}],"version-history":[{"count":0,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/posts\/1381\/revisions"}],"wp:attachment":[{"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/media?parent=1381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/categories?post=1381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/tags?post=1381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}