{"id":9092,"date":"2021-03-18T17:36:37","date_gmt":"2021-03-18T08:36:37","guid":{"rendered":"http:\/\/www.globefish.jp\/wp\/?p=9092"},"modified":"2022-05-18T08:22:23","modified_gmt":"2022-05-17T23:22:23","slug":"slackware-uefi-lvm-raid1","status":"publish","type":"post","link":"https:\/\/www.globefish.jp\/wp\/2021\/03\/slackware-uefi-lvm-raid1.html","title":{"rendered":"Slackware\u3092 UEFI+LVM(+RAID1)\u306a\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30e1\u30e2"},"content":{"rendered":"<p>Linux\u3067\u6614\u304b\u3089\u3042\u308b\u306e\u306f mdadm\u3092\u4f7f\u3063\u305f\u4ed5\u7d44\u307f\u3060\u3051\u3069\u3001\u4eca\u56de\u306f\u305b\u3063\u304b\u304f LVM\u3092\u5c0e\u5165\u3059\u308b\u306e\u3067 RAID\u3082\u305d\u3061\u3089\u306b\u4efb\u305b\u3066\u307f\u308b\u3002<br \/>\n\u3061\u306a\u307f\u306b \/boot\u306f\u5bfe\u5fdc\u3067\u304d\u306a\u3044\u3089\u3057\u3044\u306e\u3067\u3001\u3053\u3061\u3089\u306f mdadm\u3067\u3002<br \/>\n\u7528\u610f\u3057\u305f\u306e\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30c7\u30a3\u30a2\u306f slackware64-current-install-dvd.iso(2021\/3\/15\u7248)<br \/>\nUEFI\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb DVD\u304b\u3089\u8d77\u52d5\u3002<sup><a href='https:\/\/www.globefish.jp\/wp\/2021\/03\/slackware-uefi-lvm-raid1.html#1'>*1<\/a><\/sup> <br \/>\nGRUB\u304c\u8d77\u52d5\u3059\u308b\u306e\u3067 huge.s kernel\u3092\u9078\u629e\u3002<br \/>\n\u307e\u305a\u306f 2\u53f0\u5171\u540c\u3058\u69cb\u6210\u3067\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3002<sup><a href='https:\/\/www.globefish.jp\/wp\/2021\/03\/slackware-uefi-lvm-raid1.html#2'>*2<\/a><\/sup> <\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nparted \/dev\/sda<br>\nmkpart boot 1mib 500mib<br>\nset 1 boot on<br>\nmkpart root 501mib 100gib<br>\nset 2 lvm on<br>\n<br>\nparted \/dev\/sdb<br>\nsda\u3068\u540c\u3058<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>\u7d9a\u3044\u3066 LVM\u3092\u69cb\u6210\u3002(swap\u306b 4G\u3001\u6b8b\u308a\u3092 \/\u3068 \/home\/\u306b)<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\n# \u7269\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u4f5c\u6210<br>\npvcreate \/dev\/sda2<br>\n# \u30dc\u30ea\u30e5\u30fc\u30e0\u30b0\u30eb\u30fc\u30d7\u306e\u4f5c\u6210(myvg)<br>\nvgcreate myvg \/dev\/sda2<br>\n# myvg\u4e0b\u306b\u8ad6\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u4f5c\u6210(swap\u9818\u57df \/ 4G)<br>\nlvcreate -L 4G myvg -n swap<br>\n# myvg\u4e0b\u306b\u8ad6\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u4f5c\u6210(root\u9818\u57df \/ 100G)<br>\nlvcreate -L 100G myvg -n root<br>\n# myvg\u4e0b\u306b\u8ad6\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u4f5c\u6210(home\u9818\u57df \/ \u6b8b\u308a\u5168\u90e8)<br>\nlvcreate -l 100%free myvg -n home<br>\n# \/\u306e\u30b5\u30a4\u30ba\u3092\u5c11\u3057\u7e2e\u3081\u3066\u304a\u304f(RAID\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u683c\u7d0d\u7528)<br>\nlvreduce -v --size -1g myvg\/root<br>\nlvreduce -v --size -1g myvg\/home<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>2\u53f0\u76ee\u3092 LVM\u30b0\u30eb\u30fc\u30d7\u306b\u8ffd\u52a0<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nvgextend myvg \/dev\/sdb2<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>raid1\u306b\u5909\u63db\u3002<sup><a href='https:\/\/www.globefish.jp\/wp\/2021\/03\/slackware-uefi-lvm-raid1.html#3'>*3<\/a><\/sup> <sup><a href='https:\/\/www.globefish.jp\/wp\/2021\/03\/slackware-uefi-lvm-raid1.html#4'>*4<\/a><\/sup> <\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nlvconvert -v --type raid1 --mirrors 1 myvg\/root<br>\nlvconvert -v --type raid1 --mirrors 1 myvg\/home<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>\u5186\u6ed1\u306b\u3059\u3059\u3081\u308b\u305f\u3081\u306b\u4ed5\u8fbc\u307f\u3002<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nmkfs.vfat \/dev\/sda1<br>\nmkswap \/dev\/myvg\/swap<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>\u3053\u3053\u3044\u3089\u3067 Slackware\u81ea\u4f53\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u3002<br \/>\n\/dev\/myvg\/swap\u3092\u30b9\u30ef\u30c3\u30d7\u306b\u8ffd\u52a0\u3002<br \/>\n\/dev\/myvg\/root\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30bf\u30fc\u30b2\u30c3\u30c8\u306b\u3002<br \/>\n\/dev\/myvg\/home\u3092 \/home\/\u306b\u30de\u30a6\u30f3\u30c8\u3002<br \/>\n\/dev\/sda1\u306f\u81ea\u52d5\u7684\u306b \/boot\/efi\u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u308b\u3002<br \/>\n\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u9069\u5f53\u306b\u3002<br \/>\nUEFI\u304b\u3089\u8d77\u52d5\u3057\u3066\u3044\u308b\u306e\u3067 lilo\u3067\u306a\u304f elilo\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u4fc3\u3055\u308c\u308b\u306e\u3067\u5f93\u3046\u3002<br \/>\nsetup\u7d42\u4e86\u5f8c\u3001\u518d\u8d77\u52d5\u3057\u306a\u3044\u3067\u30b3\u30f3\u30bd\u30fc\u30eb\u3078\u623b\u308b\u3002<br \/>\n\u518d\u8d77\u52d5\u3057\u3066\u3057\u307e\u3063\u305f\u3089\u3082\u3046\u4e00\u5ea6\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30c7\u30a3\u30a2\u3067\u8d77\u52d5\u3057\u3001\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u6b21\u3078\u3002<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nmount \/dev\/myvg\/root \/mnt<br>\nmount \/dev\/sda1 \/mnt\/boot\/efi<br>\nmount --rbind \/dev \/mnt\/dev<br>\nmount -t proc none \/mnt\/proc<br>\nmount --rbind \/sys \/mnt\/sys<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>\u88dc\u52a9\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u3063\u3066 mkinitrd\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3092\u4f5c\u308b\u3002<br \/>\n\u3053\u306e\u969b\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068 dm_raid\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u7d44\u307f\u8fbc\u307e\u308c\u305a\u3001\u8d77\u52d5\u306b\u5931\u6557\u3059\u308b\u306e\u3067\u3061\u3087\u308d\u3063\u3068\u7d30\u5de5\u3057\u3066\u304b\u3089\u3002<br \/>\n\u518d\u8d77\u52d5\u3059\u308c\u3070 HDD\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f Slackware\u304c\u7acb\u3061\u4e0a\u304c\u308b\u306e\u3067\u3082\u3046\u4e00\u606f\u3002<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nchroot \/mnt<br>\n $(\/usr\/share\/mkinitrd\/mkinitrd_command_generator.sh -k ${KERNEL_VER} -m dm_raid -r)<br>\ncp -a \/boot\/initrd.gz \/boot\/efi\/EFI\/Slackware\/<br>\nexit<br>\nreboot<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p># boot\u30df\u30e9\u30fc\u30ea\u30f3\u30b0\u7528\u306e md\u3092\u4f5c\u308b<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nmdadm --create \/dev\/md0 --auto=yes --level=raid1 --raid-devices=2 missing \/dev\/sdb2<br>\necho 'DEVICE partitions' &gt;&gt; \/etc\/mdadm.conf<br>\nmdadm --detail --scan &gt;&gt; \/etc\/mdadm.conf<br>\necho 'MAILADDR root' &gt;&gt; \/etc\/mdadm.conf<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p># \u51fa\u6765\u305f boot\u7528 md\u306b boot\u3092\u30b3\u30d4\u30fc<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nmkfs.vfat \/dev\/md0<br>\nmount \/dev\/md0 \/mnt\/hd\/<br>\ncp -a \/boot\/efi\/* \/mnt\/hd\/<br>\numount \/mnt\/hd<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>fstab\u3082 \/dev\/md0\u3092 \/boot\/efi\/\u3078\u30de\u30a6\u30f3\u30c8\u3059\u308b\u3088\u3046\u306b\u5909\u66f4<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nsed -i -e 's\/\\\/dev\\\/sda2\/\\\/dev\\\/md0\/'<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>\u5143\u306e boot\u3092 md\u306b\u8ffd\u52a0<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nmdadm \/dev\/md0 --add \/dev\/sda2<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>FYI: <a href='https:\/\/www.nslabs.jp\/raid-logical-volumes.rhtml'>Step by Step: LVM RAID logical volume\u3067\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2RAID 1 (Fedora 33)<\/a><br \/>\nFUI: <a href='https:\/\/www.nslabs.jp\/disk-recover-raid-logical-volume.rhtml'>LVM RAID Logical Volume\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u304b\u3089\u306e\u5fa9\u65e7<\/a><\/p>\n<h2>2022\/05\/02\u8ffd\u8a18<\/h2>\n<p>Slackware\u306e\u30ab\u30fc\u30cd\u30eb\u3092\u66f4\u65b0\u5f8c\u3001\u3046\u3063\u304b\u308a initrd\u306e\u66f4\u65b0\u3092\u5fd8\u308c\u305f\u307e\u307e\u518d\u8d77\u52d5\u3057\u3066\u3057\u307e\u3063\u3066\u304b\u3089\u306e\u5f8c\u59cb\u672b\u30ed\u30b0\u3002<br \/>\nmd_raid\u304c\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u8d77\u52d5\u306b\u5931\u6557\u3059\u308b\u7fbd\u76ee\u306b\u3002<br \/>\n\u53e4\u3044\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30c7\u30a3\u30a2\u304b\u3089\u8d77\u52d5\u3059\u308b\u3082\u3001\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u7570\u306a\u308b\u306e\u3067\u4f5c\u696d\u3067\u304d\u306a\u3044\u3002<br \/>\n\u306a\u306e\u3067\u3001\u66f4\u65b0\u5f8c\u306e\u30ab\u30fc\u30cd\u30eb\u3092\u542b\u3080\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30c7\u30a3\u30a2(slackware64-current-install-dvd.iso\u7b49)\u304b\u3089\u8d77\u52d5\u3057\u3001setup\u7d42\u4e86\u5f8c\u306e\u51e6\u7406\u3092\u3057\u306a\u3044\u3067\u518d\u8d77\u52d5\u3057\u3066\u3057\u307e\u3063\u305f\u3068\u304d\u306e\u51e6\u7406\u3092\u306a\u305e\u308b\u3002<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nmount \/dev\/myvg\/root \/mnt<br>\nmount \/dev\/sda1 \/mnt\/boot\/efi<br>\nmount --rbind \/dev \/mnt\/dev<br>\nmount -t proc none \/mnt\/proc<br>\nmount --rbind \/sys \/mnt\/sys<br>\nchroot \/mnt<br>\n$(\/usr\/share\/mkinitrd\/mkinitrd_command_generator.sh -k ${KERNEL_VER} -m dm_raid -r)<br>\ncp -a \/boot\/initrd.gz \/boot\/efi\/EFI\/Slackware\/<br>\nexit<br>\nreboot<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n<p>\u901a\u5e38\u306f mkinitrd_command_generator.sh\u3067 \/boot\/initrd.gz\u3092\u4f5c\u308a\u3001\/boot\/efi\/EFI\/Slackware\/\u3078\u30b3\u30d4\u30fc\u3059\u308c\u3070\u3088\u3057\u3002<\/p>\n<h2>2022\/05\/18\u8ffd\u8a18<\/h2>\n<p>mkinitrd_command_generator.sh\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u73fe\u5728\u52d5\u4f5c\u3057\u3066\u3044\u308b\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5143\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u63a2\u3057\u306b\u884c\u304f\u306e\u3067\u30ab\u30fc\u30cd\u30eb\u306e\u66f4\u65b0\u76f4\u5f8c\u306f\u52d5\u4f5c\u3057\u3066\u3044\u308b\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u65b0\u305f\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u98df\u3044\u9055\u3044\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u65e8\u5831\u544a\u3057\u3066 initrd\u306e\u4f5c\u6210\u306b\u5931\u6557\u3057\u3066\u3057\u307e\u3046\u3002<br \/>\n\u306a\u306e\u3067\u3001\u300c-k\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u5bfe\u8c61\u3068\u306a\u308b\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u660e\u793a\u3057\u3066\u3084\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<br \/>\n\u6bce\u56de\u65b0\u305f\u306a\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u624b\u52d5\u3067\u6307\u5b9a\u3059\u308b\u306e\u306f\u99ac\u9e7f\u3089\u3057\u3044\u306e\u3067\u3053\u3093\u306a\u611f\u3058\u3067\u3002<\/p>\n<blockquote>\n<!-- begin of SyntaxColor WordPress Plugin output-->\n<div class='SyntaxColor'>\n<code>\nKERNEL_VER=`ls \/var\/log\/packages\/kernel-source-* | sed -e 's\/.*\\([0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\).\\+\/\\1\/'`<br>\n$(\/usr\/share\/mkinitrd\/mkinitrd_command_generator.sh -k ${KERNEL_VER} -m dm_raid -r)<br>\n<\/code>\n<\/div>\n<!-- end of SyntaxColor WordPress Plugin output-->\n<\/blockquote>\n\n","protected":false},"excerpt":{"rendered":"<p>Linux\u3067\u6614\u304b\u3089\u3042\u308b\u306e\u306f mdadm\u3092\u4f7f\u3063\u305f\u4ed5\u7d44\u307f\u3060\u3051\u3069\u3001\u4eca\u56de\u306f\u305b\u3063\u304b\u304f LVM\u3092\u5c0e\u5165\u3059\u308b\u306e\u3067 RAID\u3082\u305d\u3061\u3089\u306b\u4efb\u305b\u3066\u307f\u308b\u3002 \u3061\u306a\u307f\u306b \/boot\u306f\u5bfe\u5fdc\u3067\u304d\u306a\u3044\u3089\u3057\u3044\u306e\u3067\u3001\u3053\u3061\u3089\u306f mdadm\u3067\u3002 \u7528\u610f\u3057\u305f\u306e\u306f\u30a4\u30f3\u30b9&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[],"class_list":["post-9092","post","type-post","status-publish","format-standard","hentry","category-slackware"],"_links":{"self":[{"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/posts\/9092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/comments?post=9092"}],"version-history":[{"count":0,"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/posts\/9092\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/media?parent=9092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/categories?post=9092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globefish.jp\/wp\/wp-json\/wp\/v2\/tags?post=9092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}