{"id":98,"date":"2024-10-10T08:34:00","date_gmt":"2024-10-10T00:34:00","guid":{"rendered":"https:\/\/simon.ice.com.tw\/?p=98"},"modified":"2026-03-01T04:50:23","modified_gmt":"2026-02-28T20:50:23","slug":"linux-%e7%a1%ac%e7%a2%9f%e5%a4%a7%e6%96%bc2tb%e8%a3%bd%e4%bd%9clvm","status":"publish","type":"post","link":"https:\/\/simon.ice.com.tw\/?p=98","title":{"rendered":"linux \u786c\u789f\u5927\u65bc2TB\u88fd\u4f5cLVM"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\u539f\u672c\u786c\u789f\u5206\u5272\u90fd\u662f\u4f7f\u7528 fsdisk ,\u4f46\u8d85\u904e 2TB \u7684\u786c\u789f\u4e0d\u80fd\u4f7f\u7528 MBR \u5206\u5272\u8868,\u8981\u7528 GPT\n1.\u5229\u7528parted\u6307\u4ee4\u5efa\u7acbGPT\u5206\u5272\u8868\n  #sudo parted \/dev\/sdb\n      $(parted) mklabel gpt\n      $(parted) mkpart primary ext4 0GB 100%\n      $(parted) print\n      $(parted) quit\n\n2.\u5efa\u7acbLVM PV\n  #sudo pvcreate \/dev\/sdb1\n\n3.\u5efa\u7acbLVM VG name\n  #sudo vgcreate vg-backup \/dev\/sdb1\n  Volume group \"data\" successfully created\n\n4. \u5efa\u7acbLVM  LV  name\n    #sudo lvcreate -n lv-backup -l 100%FREE vg-backup\n     Logical volume \"lv-data\" created.\n\n5.\u67e5\u770b LVM \u8a2d\u5b9a\n  #sudo lvdisplay  \/dev\/vg-backup\/lv-backup\n6.\u683c\u5f0f\u5316\n  #sudo mkfs.ext4 \/dev\/vg-backup\/lv-backup\n   mkfs.xfs \u547d\u4ee4\u627e\u4e0d\u5230\u7684\u89e3\u51b3\u65b9\u6cd5\n  #sudo apt install xfsprogs\n\n7.\u67e5\u770b\u786c\u789fUUID\n  #sudo blkid \/dev\/vg-backup\/lv-backup\n   \/dev\/data\/lv-data: UUID=\"82ca6a69-9ee7-4431-82ea-ae4a810fd942\" TYPE=\"xfs\"\n\n8.\u65b0\u589ebackup\u76ee\u9304 ,\u5c07\u639b\u8f09\u8cc7\u8a0a\u52a0\u5165\/etc\/fstab\n  #sudo mkdir \/mnt\/backup\n  #sudo mkdir \/mnt\/backup\/backup_sql\n  #sudo nano \/etc\/fstab\n  #sudo systemctl daemon-reload\n  #sudo mount -a\n  #df -h\n\n9.\u5beb\u5165\u6b0a\u9650\n  #sudo chown -R simon:simon \/mnt\/backup\n  #sudo chown -R mssql:mssql \/mnt\/backup\/backup_sql\n  #sudo chmod -R 775 \/mnt\/backup\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-98","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=98"}],"version-history":[{"count":8,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":252,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/98\/revisions\/252"}],"wp:attachment":[{"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}