{"id":13106,"date":"2025-04-18T20:13:14","date_gmt":"2025-04-18T12:13:14","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/13106.html"},"modified":"2025-04-18T20:13:14","modified_gmt":"2025-04-18T12:13:14","slug":"ubuntu%e6%9c%8d%e5%8a%a1%e5%99%a8-data-%e7%9b%98%e9%9c%80%e8%a6%81%e6%89%8b%e5%8a%a8%e6%8c%82%e8%bd%bd%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/13106.html","title":{"rendered":"Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"<h3>\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848<\/h3>\n<p>\u5982\u679c\u91cd\u542f\u670d\u52a1\u5668\u540e&#xff0c;\u53d1\u73b0 \/data \u76d8 \u6ca1\u6709\u81ea\u52a8\u6302\u8f7d&#xff0c;\u901a\u5e38\u662f\u56e0\u4e3a&#xff1a;<\/p>\n<li>\/etc\/fstab \u914d\u7f6e\u6587\u4ef6 \u6ca1\u6709\u6b63\u786e\u8bbe\u7f6e \u81ea\u52a8\u6302\u8f7d\u3002<\/li>\n<li>\u8be5\u78c1\u76d8 \u6ca1\u6709\u88ab\u6b63\u786e\u8bc6\u522b&#xff0c;\u9700\u8981\u624b\u52a8\u6302\u8f7d\u3002<\/li>\n<li>\u6587\u4ef6\u7cfb\u7edf\u9519\u8bef \u5bfc\u81f4\u6302\u8f7d\u5931\u8d25\u3002<\/li>\n<p>\u4e0b\u9762\u662f\u89e3\u51b3\u65b9\u6848&#xff0c;\u786e\u4fdd \/data \u76d8\u53ef\u4ee5\u624b\u52a8\u6302\u8f7d&#xff0c;\u7136\u540e\u914d\u7f6e\u81ea\u52a8\u6302\u8f7d\u3002<\/p>\n<hr \/>\n<h3>&#x1f50d; 1. \u786e\u8ba4 \/data \u76d8\u662f\u5426\u5b58\u5728<\/h3>\n<p>\u9996\u5148&#xff0c;\u4f7f\u7528 lsblk \u6216 fdisk \u68c0\u67e5\u5f53\u524d\u78c1\u76d8\u60c5\u51b5&#xff1a;<\/p>\n<p>lsblk<\/p>\n<p>\u793a\u4f8b\u8f93\u51fa&#xff1a;<\/p>\n<p>NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT<br \/>\nsda      8:0    0   100G  0 disk \/<br \/>\nsdb      8:16   0   500G  0 disk <\/p>\n<p>\u8fd9\u91cc sdb \u53ef\u80fd\u662f \/data \u76d8&#xff0c;\u4f46\u5b83\u8fd8\u6ca1\u6709\u6302\u8f7d\u3002<\/p>\n<p>\u5982\u679c lsblk \u4e0d\u80fd\u786e\u8ba4&#xff0c;\u53ef\u4ee5\u4f7f\u7528&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">fdisk<\/span> <span class=\"token parameter variable\">-l<\/span><\/p>\n<p>\u6216\u8005&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> blkid<\/p>\n<hr \/>\n<h3>&#x1f4cc; 2. \u624b\u52a8\u6302\u8f7d \/data \u76d8<\/h3>\n<h4>2.1 \u786e\u8ba4 \/data \u76ee\u5f55\u662f\u5426\u5b58\u5728<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/data<\/p>\n<h4>2.2 \u6302\u8f7d\u78c1\u76d8<\/h4>\n<p>\u5982\u679c lsblk \u663e\u793a \/data \u76d8\u662f \/dev\/sdb1&#xff0c;\u624b\u52a8\u6302\u8f7d&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> \/dev\/sdb1 \/data<\/p>\n<p>\u7136\u540e\u68c0\u67e5\u662f\u5426\u6210\u529f\u6302\u8f7d&#xff1a;<\/p>\n<p><span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-h<\/span><\/p>\n<p>\u5982\u679c \/data \u76d8\u5df2\u6302\u8f7d&#xff0c;\u8bf4\u660e\u624b\u52a8\u6302\u8f7d\u6210\u529f\u3002<\/p>\n<hr \/>\n<h3>&#x1f504; 3. \u914d\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d<\/h3>\n<p>\u5982\u679c \/data \u76d8\u9700\u8981 \u5f00\u673a\u81ea\u52a8\u6302\u8f7d&#xff0c;\u9700\u8981\u4fee\u6539 \/etc\/fstab\u3002<\/p>\n<h4>3.1 \u83b7\u53d6\u78c1\u76d8 UUID<\/h4>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u83b7\u53d6 \/data \u76d8\u7684 UUID&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> blkid<\/p>\n<p>\u793a\u4f8b\u8f93\u51fa&#xff1a;<\/p>\n<p>\/dev\/sdb1: UUID&#061;&#034;1234-ABCD-5678-EFGH&#034; TYPE&#061;&#034;ext4&#034;<\/p>\n<h4>3.2 \u7f16\u8f91 \/etc\/fstab<\/h4>\n<p>\u6253\u5f00 \/etc\/fstab&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/fstab<\/p>\n<p>\u6dfb\u52a0\u4e00\u884c&#xff1a;<\/p>\n<p>UUID&#061;1234-ABCD-5678-EFGH  \/data  ext4  defaults  0 2<\/p>\n<p>\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>UUID&#061;1234-ABCD-5678-EFGH&#xff1a;\u78c1\u76d8\u7684 UUID&#xff08;\u7528\u4f60\u81ea\u5df1\u78c1\u76d8\u7684 UUID \u66ff\u6362&#xff09;\u3002<\/li>\n<li>\/data&#xff1a;\u6302\u8f7d\u70b9\u3002<\/li>\n<li>ext4&#xff1a;\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&#xff08;\u5982\u679c\u4f60\u7684\u78c1\u76d8\u662f xfs&#xff0c;\u6539\u4e3a xfs&#xff09;\u3002<\/li>\n<li>defaults&#xff1a;\u5e38\u89c4\u6302\u8f7d\u9009\u9879&#xff0c;\u8868\u793a\u8bfb\u5199\u6743\u9650\u6b63\u5e38\u3002<\/li>\n<li>0 2&#xff1a;\n<ul>\n<li>0&#xff1a;\u4e0d\u8fdb\u884c dump \u5907\u4efd&#xff08;\u901a\u5e38 0&#xff09;\u3002<\/li>\n<li>2&#xff1a;\u7528\u4e8e fsck \u68c0\u67e5\u78c1\u76d8\u9519\u8bef&#xff0c;\/ \u76d8\u7528 1&#xff0c;\u5176\u4ed6\u76d8\u4e00\u822c\u7528 2\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u4fdd\u5b58\u6587\u4ef6&#xff08;\u6309 Ctrl &#043; X \u2192 Y \u2192 Enter&#xff09;\u3002<\/p>\n<h4>3.3 \u6d4b\u8bd5 \/etc\/fstab \u662f\u5426\u6b63\u786e<\/h4>\n<p>\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-a<\/span><\/p>\n<p>\u5982\u679c\u6ca1\u6709\u62a5\u9519&#xff0c;\u8bf4\u660e \/etc\/fstab \u914d\u7f6e\u6b63\u786e\u3002<\/p>\n<h4>3.4 \u91cd\u542f\u5e76\u68c0\u67e5<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">reboot<\/span><\/p>\n<p>\u91cd\u542f\u540e&#xff0c;\u68c0\u67e5 \/data \u662f\u5426\u6210\u529f\u6302\u8f7d&#xff1a;<\/p>\n<p><span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-h<\/span><\/p>\n<p>\u5982\u679c \/data \u6b63\u5e38\u663e\u793a\u5728\u5217\u8868\u4e2d&#xff0c;\u8bf4\u660e \u5f00\u673a\u81ea\u52a8\u6302\u8f7d\u6210\u529f&#xff01; &#x1f389;<\/p>\n<hr \/>\n<h3>&#x1f6e0;\ufe0f 4. \u5176\u4ed6\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898<\/h3>\n<h4>\u274c \u95ee\u9898 1&#xff1a;\u624b\u52a8\u6302\u8f7d\u65f6\u62a5\u9519<\/h4>\n<p>\u5982\u679c mount \/dev\/sdb1 \/data \u62a5\u9519&#xff1a;<\/p>\n<p>mount: unknown filesystem type &#039;ext4&#039;<\/p>\n<p>\u53ef\u80fd\u662f\u6587\u4ef6\u7cfb\u7edf\u672a\u683c\u5f0f\u5316&#xff0c;\u9700\u8981\u683c\u5f0f\u5316&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> mkfs.ext4 \/dev\/sdb1<\/p>\n<p>\u26a0 \u6ce8\u610f&#xff1a;\u8fd9\u4f1a\u6e05\u7a7a \/dev\/sdb1 \u78c1\u76d8\u4e0a\u7684\u6240\u6709\u6570\u636e&#xff01;\u5982\u679c\u78c1\u76d8\u4e0a\u6709\u91cd\u8981\u6570\u636e&#xff0c;\u4e0d\u8981\u6267\u884c\u8fd9\u4e00\u6b65&#xff01;<\/p>\n<hr \/>\n<h4>\u274c \u95ee\u9898 2&#xff1a;\u6302\u8f7d\u540e \/data \u4e3a\u7a7a<\/h4>\n<p>\u5982\u679c\u4f60\u4e4b\u524d\u5b58\u50a8\u7684\u6570\u636e\u4e22\u5931&#xff0c;\u53ef\u80fd\u662f \u6302\u8f7d\u4e86\u9519\u8bef\u7684\u5206\u533a&#xff0c;\u5c1d\u8bd5&#xff1a;<\/p>\n<p>lsblk<br \/>\n<span class=\"token function\">sudo<\/span> blkid<\/p>\n<p>\u627e\u5230\u6b63\u786e\u7684\u78c1\u76d8\u8def\u5f84\u518d\u6302\u8f7d\u3002<\/p>\n<hr \/>\n<h4>\u274c \u95ee\u9898 3&#xff1a;\/etc\/fstab \u914d\u7f6e\u9519\u8bef&#xff0c;\u5bfc\u81f4\u7cfb\u7edf\u65e0\u6cd5\u542f\u52a8<\/h4>\n<p>\u5982\u679c \/etc\/fstab \u5199\u9519\u4e86&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4 \u7cfb\u7edf\u65e0\u6cd5\u542f\u52a8\u3002 \u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<li>\n<p>\u8fdb\u5165\u6062\u590d\u6a21\u5f0f&#xff1a;<\/p>\n<ul>\n<li>\u5728\u5f00\u673a\u5f15\u5bfc\u65f6\u6309 ESC \u6216 Shift \u8fdb\u5165 GRUB \u83dc\u5355\u3002<\/li>\n<li>\u9009\u62e9 Advanced options \u2192 Recovery mode\u3002<\/li>\n<li>\u9009\u62e9 Drop to root shell \u8fdb\u5165\u547d\u4ee4\u884c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7f16\u8f91 \/etc\/fstab \u5e76\u4fee\u590d\u9519\u8bef&#xff1a;<\/p>\n<p> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-o<\/span> remount,rw \/<br \/>\n<span class=\"token function\">nano<\/span> \/etc\/fstab<\/p>\n<ul>\n<li>\u5220\u9664\u6216\u4fee\u6b63\u9519\u8bef\u7684\u6302\u8f7d\u884c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf&#xff1a;<\/p>\n<p> <span class=\"token function\">reboot<\/span>\n <\/li>\n<hr \/>\n<h3>\u2705 \u603b\u7ed3<\/h3>\n<table>\n<tr>\u6b65\u9aa4\u547d\u4ee4\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u68c0\u67e5\u78c1\u76d8<\/td>\n<td>lsblk \/ fdisk -l \/ blkid<\/td>\n<td>\u627e\u5230 \/data \u76d8\u5bf9\u5e94\u7684\u8bbe\u5907<\/td>\n<\/tr>\n<tr>\n<td>\u624b\u52a8\u6302\u8f7d<\/td>\n<td>sudo mount \/dev\/sdb1 \/data<\/td>\n<td>\u4e34\u65f6\u6302\u8f7d\u78c1\u76d8<\/td>\n<\/tr>\n<tr>\n<td>\u5f00\u673a\u81ea\u52a8\u6302\u8f7d<\/td>\n<td>\u7f16\u8f91 \/etc\/fstab<\/td>\n<td>\u6dfb\u52a0 UUID&#061;xxx \/data ext4 defaults 0 2<\/td>\n<\/tr>\n<tr>\n<td>\u6d4b\u8bd5 fstab \u662f\u5426\u6b63\u786e<\/td>\n<td>sudo mount -a<\/td>\n<td>\u68c0\u67e5\u914d\u7f6e\u662f\u5426\u6b63\u786e<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u542f\u68c0\u67e5<\/td>\n<td>df -h<\/td>\n<td>\u786e\u4fdd \/data \u76d8\u5f00\u673a\u81ea\u52a8\u6302\u8f7d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>&#x1f680; \u73b0\u5728&#xff0c;\u60a8\u7684 \/data \u76d8\u5e94\u8be5\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u91cd\u542f\u540e\u81ea\u52a8\u6302\u8f7d\u4e86&#xff01; &#x1f680; \u5982\u679c\u8fd8\u6709\u95ee\u9898&#xff0c;\u8bf7\u63d0\u4f9b lsblk\u3001df -h \u548c \/etc\/fstab \u914d\u7f6e&#xff0c;\u6211\u53ef\u4ee5\u5e2e\u4f60\u8fdb\u4e00\u6b65\u6392\u67e5&#xff01;&#x1f60a;<\/p>\n<p>$ sudo lsblk -l [sudo] password for: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 63.7M 1 loop \/snap\/core20\/2434 loop1 7:1 0 63.7M 1 loop \/snap\/core20\/2496 loop2 7:2 0 87M 1 loop \/snap\/lxd\/29351 loop3 7:3 0 89.4M 1 loop \/snap\/lxd\/31333 loop4 7:4 0 44.3M 1 loop \/snap\/snapd\/23258 loop5 7:5 0 44.4M 1 loop \/snap\/snapd\/23545 sda 8:0 0 447.1G 0 disk sda1 8:1 0 1G 0 part \/boot\/efi sda2 8:2 0 2G 0 part \/boot sda3 8:3 0 444G 0 part sdb 8:16 0 29.1T 0 disk ubuntu\u2013vg-ubuntu\u2013lv 253:0 0 100G 0 lvm \/\u8fd9\u91cc\u7684sdb\u5c31\u662f\u6211\u8981\u7684\u76d8&#xff0c;\u5982\u4f55\u6302\u8f7d<\/p>\n<h4>\u6302\u8f7d sdb \u76d8\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d<\/h4>\n<p>\u4f60\u7684 lsblk -l \u8f93\u51fa\u4e2d\u663e\u793a&#xff1a;<\/p>\n<p>sdb                     8:16   0  29.1T  0 disk<\/p>\n<p>\u8fd9\u8868\u793a sdb \u662f\u4e00\u5757 \u672a\u5206\u533a \u6216 \u672a\u6302\u8f7d \u7684\u78c1\u76d8&#xff0c;\u603b\u5927\u5c0f 29.1T\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u5b8c\u6574\u7684 \u6302\u8f7d sdb \u7684\u6b65\u9aa4&#xff0c;\u5305\u62ec \u624b\u52a8\u6302\u8f7d\u3001\u683c\u5f0f\u5316\u3001\u5206\u533a\u3001\u4ee5\u53ca\u5f00\u673a\u81ea\u52a8\u6302\u8f7d\u3002<\/p>\n<hr \/>\n<h3>&#x1f50d; 1. \u68c0\u67e5 sdb \u662f\u5426\u5df2\u6709\u5206\u533a<\/h3>\n<p>\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">fdisk<\/span> <span class=\"token parameter variable\">-l<\/span> \/dev\/sdb<\/p>\n<p>\u5982\u679c\u8f93\u51fa\u7c7b\u4f3c&#xff1a;<\/p>\n<p>Disk \/dev\/sdb doesn&#039;t contain a valid partition table<\/p>\n<p>\u8bf4\u660e sdb \u6ca1\u6709\u5206\u533a&#xff0c;\u9700\u8981\u683c\u5f0f\u5316&#xff08;\u5982\u679c\u6709\u6570\u636e&#xff0c;\u8bf7\u63d0\u524d\u5907\u4efd&#xff09;\u3002<\/p>\n<hr \/>\n<h3>&#x1f4cc; 2. \u6302\u8f7d sdb&#xff08;\u5982\u679c\u5df2\u7ecf\u683c\u5f0f\u5316&#xff09;<\/h3>\n<p>\u5982\u679c sdb \u5df2\u7ecf\u683c\u5f0f\u5316&#xff08;fdisk -l \u663e\u793a\u6709\u5206\u533a&#xff0c;\u5982 \/dev\/sdb1&#xff09;&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u6302\u8f7d&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/data  <span class=\"token comment\"># \u521b\u5efa\u6302\u8f7d\u70b9<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> \/dev\/sdb1 \/data  <span class=\"token comment\"># \u6302\u8f7d<\/span><\/p>\n<p>\u7136\u540e\u68c0\u67e5\u662f\u5426\u6302\u8f7d\u6210\u529f&#xff1a;<\/p>\n<p><span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-h<\/span><\/p>\n<p>\u5982\u679c \/data \u76ee\u5f55\u4e2d\u53ef\u4ee5\u770b\u5230\u78c1\u76d8\u7a7a\u95f4&#xff0c;\u8bf4\u660e\u6302\u8f7d\u6210\u529f\u3002<\/p>\n<hr \/>\n<h3>&#x1f504; 3. \u521b\u5efa\u5206\u533a&#xff08;\u5982\u679c sdb \u6ca1\u6709\u5206\u533a&#xff09;<\/h3>\n<p>\u5982\u679c fdisk -l \/dev\/sdb \u663e\u793a sdb \u6ca1\u6709\u5206\u533a&#xff0c;\u5219\u9700\u8981\u5148\u521b\u5efa\u5206\u533a\u3002<\/p>\n<h4>3.1 \u4f7f\u7528 fdisk \u521b\u5efa\u5206\u533a<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">fdisk<\/span> \/dev\/sdb<\/p>\n<p>\u5728 fdisk \u547d\u4ee4\u884c&#xff1a;<\/p>\n<li>\u8f93\u5165 n&#xff08;\u65b0\u5efa\u5206\u533a&#xff09;<\/li>\n<li>\u6309 Enter&#xff08;\u9ed8\u8ba4\u4e3b\u5206\u533a&#xff09;<\/li>\n<li>\u6309 Enter&#xff08;\u4f7f\u7528\u9ed8\u8ba4\u8d77\u59cb\u6247\u533a&#xff09;<\/li>\n<li>\u6309 Enter&#xff08;\u4f7f\u7528\u6574\u4e2a\u78c1\u76d8&#xff09;<\/li>\n<li>\u8f93\u5165 w&#xff08;\u5199\u5165\u5e76\u9000\u51fa&#xff09;<\/li>\n<h4>3.2 \u683c\u5f0f\u5316\u5206\u533a<\/h4>\n<p>\u5047\u8bbe\u5206\u533a\u540d\u79f0\u4e3a \/dev\/sdb1&#xff0c;\u4f7f\u7528 mkfs.ext4 \u8fdb\u884c\u683c\u5f0f\u5316&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> mkfs.ext4 \/dev\/sdb1<\/p>\n<p>\u26a0 \u8b66\u544a&#xff1a;\u683c\u5f0f\u5316\u4f1a\u6e05\u7a7a\u6240\u6709\u6570\u636e&#xff01;\u5982\u679c sdb \u91cc\u6709\u6570\u636e&#xff0c;\u8bf7\u5148\u5907\u4efd\u3002<\/p>\n<hr \/>\n<h3>&#x1f4cc; 4. \u624b\u52a8\u6302\u8f7d sdb1<\/h3>\n<p>\u521b\u5efa\u6302\u8f7d\u70b9&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/data<\/p>\n<p>\u6302\u8f7d\u78c1\u76d8&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> \/dev\/sdb1 \/data<\/p>\n<p>\u68c0\u67e5\u662f\u5426\u6210\u529f&#xff1a;<\/p>\n<p><span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-h<\/span><\/p>\n<p>\u5982\u679c \/data \u663e\u793a sdb1 \u7684\u5bb9\u91cf&#xff0c;\u8bf4\u660e\u6302\u8f7d\u6210\u529f\u3002<\/p>\n<hr \/>\n<h3>&#x1f504; 5. \u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d<\/h3>\n<h4>5.1 \u83b7\u53d6 sdb1 \u7684 UUID<\/h4>\n<p>\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> blkid \/dev\/sdb1<\/p>\n<p>\u793a\u4f8b\u8f93\u51fa&#xff1a;<\/p>\n<p>\/dev\/sdb1: UUID&#061;&#034;1234-ABCD-5678-EFGH&#034; TYPE&#061;&#034;ext4&#034;<\/p>\n<h4>5.2 \u7f16\u8f91 \/etc\/fstab<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/fstab<\/p>\n<p>\u6dfb\u52a0\u4e00\u884c&#xff1a;<\/p>\n<p>UUID&#061;1234-ABCD-5678-EFGH  \/data  ext4  defaults  0 2<\/p>\n<p>\u89e3\u91ca&#xff1a;<\/p>\n<ul>\n<li>UUID&#061;1234-ABCD-5678-EFGH&#xff08;\u7528 blkid \u8f93\u51fa\u7684 UUID&#xff09;\u3002<\/li>\n<li>\/data&#xff08;\u6302\u8f7d\u70b9&#xff09;\u3002<\/li>\n<li>ext4&#xff08;\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&#xff09;\u3002<\/li>\n<li>defaults&#xff08;\u6302\u8f7d\u9009\u9879&#xff09;\u3002<\/li>\n<li>0 2&#xff08;\u6587\u4ef6\u7cfb\u7edf\u68c0\u67e5\u987a\u5e8f&#xff0c;2 \u4ee3\u8868\u975e \/ \u5206\u533a&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u4fdd\u5b58\u5e76\u9000\u51fa&#xff08;\u6309 Ctrl &#043; X \u2192 Y \u2192 Enter&#xff09;\u3002<\/p>\n<h4>5.3 \u6d4b\u8bd5 \/etc\/fstab \u662f\u5426\u6b63\u786e<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-a<\/span><\/p>\n<p>\u5982\u679c\u6ca1\u6709\u9519\u8bef&#xff0c;\u5219 \/etc\/fstab \u914d\u7f6e\u6b63\u786e\u3002<\/p>\n<hr \/>\n<h3>&#x1f4cc; 6. \u91cd\u65b0\u542f\u52a8\u5e76\u68c0\u67e5<\/h3>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">reboot<\/span><\/p>\n<p>\u91cd\u542f\u540e\u68c0\u67e5&#xff1a;<\/p>\n<p><span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-h<\/span><\/p>\n<p>\u5982\u679c \/data \u4ecd\u7136\u6b63\u786e\u6302\u8f7d&#xff0c;\u8bf4\u660e \u6302\u8f7d\u6210\u529f &#x1f389;\u3002<\/p>\n<hr \/>\n<h3>&#x1f680; \u603b\u7ed3<\/h3>\n<table>\n<tr>\u6b65\u9aa4\u547d\u4ee4\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u68c0\u67e5\u78c1\u76d8<\/td>\n<td>lsblk \/ fdisk -l \/dev\/sdb<\/td>\n<td>\u786e\u4fdd sdb \u5b58\u5728<\/td>\n<\/tr>\n<tr>\n<td>\u624b\u52a8\u6302\u8f7d&#xff08;\u5df2\u6709\u683c\u5f0f&#xff09;<\/td>\n<td>sudo mount \/dev\/sdb1 \/data<\/td>\n<td>\u5982\u679c sdb \u5df2\u6709\u683c\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>\u521b\u5efa\u5206\u533a&#xff08;\u82e5\u65e0&#xff09;<\/td>\n<td>sudo fdisk \/dev\/sdb \u2192 n \u2192 w<\/td>\n<td>\u521b\u5efa \/dev\/sdb1<\/td>\n<\/tr>\n<tr>\n<td>\u683c\u5f0f\u5316&#xff08;\u6e05\u7a7a\u6570\u636e&#xff09;<\/td>\n<td>sudo mkfs.ext4 \/dev\/sdb1<\/td>\n<td>\u683c\u5f0f\u5316\u4e3a ext4<\/td>\n<\/tr>\n<tr>\n<td>\u521b\u5efa\u6302\u8f7d\u70b9<\/td>\n<td>sudo mkdir -p \/data<\/td>\n<td>\u786e\u4fdd \/data \u5b58\u5728<\/td>\n<\/tr>\n<tr>\n<td>\u6302\u8f7d\u78c1\u76d8<\/td>\n<td>sudo mount \/dev\/sdb1 \/data<\/td>\n<td>\u624b\u52a8\u6302\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>\u83b7\u53d6 UUID<\/td>\n<td>sudo blkid \/dev\/sdb1<\/td>\n<td>\u7528\u4e8e \/etc\/fstab \u6301\u4e45\u6302\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>\u914d\u7f6e \/etc\/fstab<\/td>\n<td>sudo nano \/etc\/fstab<\/td>\n<td>\u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>\u6d4b\u8bd5\u6302\u8f7d<\/td>\n<td>sudo mount -a<\/td>\n<td>\u68c0\u67e5 \/etc\/fstab \u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u542f\u68c0\u67e5<\/td>\n<td>sudo reboot \u2192 df -h<\/td>\n<td>\u786e\u4fdd \/data \u76d8\u81ea\u52a8\u6302\u8f7d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f680; \u73b0\u5728\u4f60\u7684 \/data \u76d8\u5e94\u8be5\u53ef\u4ee5 \u6c38\u4e45\u81ea\u52a8\u6302\u8f7d \u4e86&#xff01; \u5982\u679c\u8fd8\u6709\u95ee\u9898&#xff0c;\u63d0\u4f9b lsblk\u3001df -h \u548c \/etc\/fstab \u914d\u7f6e&#xff0c;\u6211\u53ef\u4ee5\u7ee7\u7eed\u5e2e\u4f60\u6392\u67e5&#xff01;&#x1f60a;<\/p>\n<h3>\u540e\u8bb0<\/h3>\n<p>2025\u5e742\u670822\u65e519\u70b918\u5206\u4e8e\u4e0a\u6d77&#xff0c;\u5728GPT 4o\u5927\u6a21\u578b\u8f85\u52a9\u4e0b\u5b8c\u6210\u3002\u786e\u5b9e\u5b8c\u6210\u4e86\u670d\u52a1\u5668\u6302\u8f7d\u7684\u4efb\u52a1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf26\u6b21\u3002\u4e0b\u9762\u662f\u89e3\u51b3\u65b9\u6848\uff0c\u786e\u4fdd \/data \u76d8\u53ef\u4ee5\u624b\u52a8\u6302\u8f7d\uff0c\u7136\u540e\u914d\u7f6e\u81ea\u52a8\u6302\u8f7d\u3002_\u6570\u636e\u76d8\u624b\u52a8\u6302\u8f7d<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,103,43,44],"topic":[],"class_list":["post-13106","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-ubuntu","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/13106.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf26\u6b21\u3002\u4e0b\u9762\u662f\u89e3\u51b3\u65b9\u6848\uff0c\u786e\u4fdd \/data \u76d8\u53ef\u4ee5\u624b\u52a8\u6302\u8f7d\uff0c\u7136\u540e\u914d\u7f6e\u81ea\u52a8\u6302\u8f7d\u3002_\u6570\u636e\u76d8\u624b\u52a8\u6302\u8f7d\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/13106.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T12:13:14+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/13106.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/13106.html\",\"name\":\"Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T12:13:14+00:00\",\"dateModified\":\"2025-04-18T12:13:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/13106.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/13106.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/13106.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/13106.html","og_locale":"zh_CN","og_type":"article","og_title":"Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf26\u6b21\u3002\u4e0b\u9762\u662f\u89e3\u51b3\u65b9\u6848\uff0c\u786e\u4fdd \/data \u76d8\u53ef\u4ee5\u624b\u52a8\u6302\u8f7d\uff0c\u7136\u540e\u914d\u7f6e\u81ea\u52a8\u6302\u8f7d\u3002_\u6570\u636e\u76d8\u624b\u52a8\u6302\u8f7d","og_url":"https:\/\/www.wsisp.com\/helps\/13106.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T12:13:14+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/13106.html","url":"https:\/\/www.wsisp.com\/helps\/13106.html","name":"Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T12:13:14+00:00","dateModified":"2025-04-18T12:13:14+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/13106.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/13106.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/13106.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Ubuntu\u670d\u52a1\u5668 \/data \u76d8\u9700\u8981\u624b\u52a8\u6302\u8f7d\u7684\u89e3\u51b3\u65b9\u6848"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/13106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=13106"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/13106\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=13106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=13106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=13106"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=13106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}