{"id":116484,"date":"2018-08-24T08:56:30","date_gmt":"2018-08-24T00:56:30","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=116484"},"modified":"2018-08-20T16:57:09","modified_gmt":"2018-08-20T08:57:09","slug":"xiangjie-linux-ygf","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/xiangjie-linux-ygf.html","title":{"rendered":"\u8be6\u89e3:Linux \u786c\u76d8\uff0c\u683c\u5f0f\u5316\uff0c\u5206\u533a \u8be6\u89e3"},"content":{"rendered":"

disk\u662fLinux\u81ea\u5e26\u7684\u786c\u76d8\u5206\u533a\u5de5\u5177\uff0c\u53ef\u4ee5\u5bf9\u786c\u76d8\u8fdb\u884c\u5206\u533a\uff0c\u6216\u8005\u5bf9\u786c\u76d8\u5206\u533a\u8fdb\u884c\u8c03\u6574\u3002<\/p>\n

\u9996\u5148\u9009\u62e9\u8981\u8fdb\u884c\u64cd\u4f5c\u7684\u78c1\u76d8<\/p>\n

[root@linuxidc ~]# fdisk \/dev\/sdb<\/pre>\n

\u8f93\u5165m\uff0c\u5217\u51fa\u53ef\u4ee5\u6267\u884c\u7684\u547d\u4ee4<\/p>\n

\r\nCommand (m for help): m\r\n Command action\r\n a toggle a bootable flag\r\n b edit bsd disklabel\r\n c toggle the dos compatibility flag\r\n d delete a partition\r\n l list known partition types\r\n m print this menu\r\n n add a new partition\r\n o create a new empty DOS partition table\r\n p print the partition table\r\n q quit without saving changes\r\n s create a new empty Sun disklabel\r\n t change a partition's system id\r\n u change display\/entry units\r\n v verify the partition table\r\n w write table to disk and exit\r\n x extra functionality (experts only)\r\n<\/pre>\n

\u8f93\u5165p\uff0c\u5217\u51fa\u78c1\u76d8\u76ee\u524d\u7684\u5206\u533a\u60c5\u51b5<\/p>\n

\r\nCommand (m for help): p\r\n\r\nDisk \/dev\/sdb: 3221 MB, 3221225472 bytes\r\n 255 heads, 63 sectors\/track, 391 cylinders\r\n Units = cylinders of 16065 * 512 = 8225280 bytes\r\n\r\nDevice Boot Start End Blocks Id System\r\n \/dev\/sdb1 1 1 8001 8e Linux LVM\r\n \/dev\/sdb2 2 26 200812+ 83 Linux\r\n<\/pre>\n

\u8f93\u5165d\uff0c\u7136\u540e\u9009\u62e9\u5206\u533a\uff0c\u5220\u9664\u73b0\u6709\u5206\u533a<\/p>\n

\r\nCommand (m for help): d\r\n Partition number (1-4): 1\r\n\r\nCommand (m for help): d\r\n Selected partition 2\r\n<\/pre>\n

\u67e5\u770b\u5206\u533a\u60c5\u51b5\uff0c\u786e\u8ba4\u5206\u533a\u5df2\u7ecf\u5220\u9664<\/p>\n

\r\nCommand (m for help): print\r\n\r\nDisk \/dev\/sdb: 3221 MB, 3221225472 bytes\r\n 255 heads, 63 sectors\/track, 391 cylinders\r\n Units = cylinders of 16065 * 512 = 8225280 bytes\r\n\r\nDevice Boot Start End Blocks Id System\r\n\r\nCommand (m for help):\r\n<\/pre>\n

\u8f93\u5165n\uff0c\u5efa\u7acb\u65b0\u7684\u78c1\u76d8\u5206\u533a\uff0c\u9996\u5148\u5efa\u7acb\u4e24\u4e2a\u4e3b\u78c1\u76d8\u5206\u533a<\/p>\n

\r\nCommand (m for help): n\r\n Command action\r\n e extended\r\n p primary partition (1-4)\r\n p \/\/\u5efa\u7acb\u4e3b\u5206\u533a\r\nPartition number (1-4): 1 \/\/\u5206\u533a\u53f7\r\nFirst cylinder (1-391, default 1): \/\/\u5206\u533a\u8d77\u59cb\u4f4d\u7f6e\r\nUsing default value 1\r\n Last cylinder or +size or +sizeM or +sizeK (1-391, default 391): 100 \/\/\u5206\u533a\u7ed3\u675f\u4f4d\u7f6e\uff0c\u5355\u4f4d\u4e3a\u6247\u533a\r\n\r\nCommand (m for help): n \/\/\u518d\u5efa\u7acb\u4e00\u4e2a\u5206\u533a\r\nCommand action\r\n e extended\r\n p primary partition (1-4)\r\n p \r\n Partition number (1-4): 2 \/\/\u5206\u533a\u53f7\u4e3a2\r\n First cylinder (101-391, default 101): \r\n Using default value 101\r\n Last cylinder or +size or +sizeM or +sizeK (101-391, default 391): +200M \/\/\u5206\u533a\u7ed3\u675f\u4f4d\u7f6e\uff0c\u5355\u4f4d\u4e3aM\r\n<\/pre>\n

\u786e\u8ba4\u5206\u533a\u5efa\u7acb\u6210\u529f<\/p>\n

\r\nCommand (m for help): p\r\n\r\nDisk \/dev\/sdb: 3221 MB, 3221225472 bytes\r\n 255 heads, 63 sectors\/track, 391 cylinders\r\n Units = cylinders of 16065 * 512 = 8225280 bytes\r\n\r\nDevice Boot Start End Blocks Id System\r\n \/dev\/sdb1 1 100 803218+ 83 Linux\r\n \/dev\/sdb2 101 125 200812+ 83 Linux\r\n<\/pre>\n

\u518d\u5efa\u7acb\u4e00\u4e2a\u903b\u8f91\u5206\u533a<\/p>\n

\r\nCommand (m for help): n\r\n Command action\r\n e extended\r\n p primary partition (1-4)\r\n e \/\/\u9009\u62e9\u6269\u5c55\u5206\u533a\r\nPartition number (1-4): 3\r\n First cylinder (126-391, default 126): \r\n Using default value 126\r\n Last cylinder or +size or +sizeM or +sizeK (126-391, default 391): \r\n Using default value 391\r\n<\/pre>\n

\u786e\u8ba4\u6269\u5c55\u5206\u533a\u5efa\u7acb\u6210\u529f<\/p>\n

\r\nCommand (m for help): p\r\n\r\nDisk \/dev\/sdb: 3221 MB, 3221225472 bytes\r\n 255 heads, 63 sectors\/track, 391 cylinders\r\n Units = cylinders of 16065 * 512 = 8225280 bytes\r\n\r\nDevice Boot Start End Blocks Id System\r\n \/dev\/sdb1 1 100 803218+ 83 Linux\r\n \/dev\/sdb2 101 125 200812+ 83 Linux\r\n\/dev\/sdb3 126 391 2136645 5 Extended\r\n<\/pre>\n

\u5728\u6269\u5c55\u5206\u533a\u4e0a\u5efa\u7acb\u4e24\u4e2a\u903b\u8f91\u5206\u533a<\/p>\n

\r\nCommand (m for help): n\r\n Command action\r\n l logical (5 or over)\r\n p primary partition (1-4)\r\n l \/\/\u9009\u62e9\u903b\u8f91\u5206\u533a\r\nFirst cylinder (126-391, default 126): \r\n Using default value 126\r\n Last cylinder or +size or +sizeM or +sizeK (126-391, default 391): +400M\r\n\r\nCommand (m for help): n\r\n Command action\r\n l logical (5 or over)\r\n p primary partition (1-4)\r\n l\r\n First cylinder (176-391, default 176): \r\n Using default value 176\r\n Last cylinder or +size or +sizeM or +sizeK (176-391, default 391): \r\n Using default value 391\r\n<\/pre>\n

\u786e\u8ba4\u903b\u8f91\u5206\u533a\u5efa\u7acb\u6210\u529f<\/p>\n

\r\nCommand (m for help): p\r\n\r\nDisk \/dev\/sdb: 3221 MB, 3221225472 bytes\r\n 255 heads, 63 sectors\/track, 391 cylinders\r\n Units = cylinders of 16065 * 512 = 8225280 bytes\r\n\r\nDevice Boot Start End Blocks Id System\r\n \/dev\/sdb1 1 100 803218+ 83 Linux\r\n \/dev\/sdb2 101 125 200812+ 83 Linux\r\n \/dev\/sdb3 126 391 2136645 5 Extended\r\n \/dev\/sdb5 126 175 401593+ 83 Linux\r\n \/dev\/sdb6 176 391 1734988+ 83 Linux\r\n\r\nCommand (m for help):\r\n<\/pre>\n

\u4ece\u4e0a\u9762\u7684\u7ed3\u679c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u5728\u786c\u76d8sdb\u6211\u4eec\u5efa\u7acb\u4e862\u4e2a\u4e3b\u5206\u533a\uff08sdb1\uff0csdb2\uff09\uff0c1\u4e2a\u6269\u5c55\u5206\u533a\uff08sdb3\uff09\uff0c2\u4e2a\u903b\u8f91\u5206\u533a\uff08sdb5\uff0csdb6\uff09<\/p>\n

\u6ce8\u610f\uff1a\u4e3b\u5206\u533a\u548c\u6269\u5c55\u5206\u533a\u7684\u78c1\u76d8\u53f7\u4f4d1-4\uff0c\u4e5f\u5c31\u662f\u8bf4\u6700\u591a\u67094\u4e2a\u4e3b\u5206\u533a\u6216\u8005\u6269\u5c55\u5206\u533a\uff0c\u903b\u8f91\u5206\u533a\u5f00\u59cb\u7684\u78c1\u76d8\u53f7\u4e3a5\uff0c\u56e0\u6b64\u5728\u8fd9\u4e2a\u5b9e\u9a8c\u4e2d\u8bd5\u6ca1\u6709sdb4\u7684\u3002<\/p>\n

\u6700\u540e\u5bf9\u5206\u533a\u64cd\u4f5c\u8fdb\u884c\u4fdd\u5b58<\/p>\n

\r\nCommand (m for help): w\r\n The partition table has been altered!\r\n\r\nCalling ioctl() to re-read partition table.\r\n Syncing disks.\r\n<\/pre>\n

\u5efa\u7acb\u597d\u5206\u533a\u4e4b\u540e\u6211\u4eec\u8fd8\u9700\u8981\u5bf9\u5206\u533a\u8fdb\u884c\u683c\u5f0f\u5316\u624d\u80fd\u5728\u7cfb\u7edf\u4e2d\u4f7f\u7528\u78c1\u76d8\u3002<\/p>\n

\u5728sdb1\u4e0a\u5efa\u7acbext2\u5206\u533a<\/p>\n

\r\n[root@linuxidc ~]# mkfs.ext2 \/dev\/sdb1\r\nmke2fs 1.39 (29-May-2006)\r\n Filesystem label=\r\n OS type: Linux\r\n Block size=4096 (log=2)\r\n Fragment size=4096 (log=2)\r\n 100576 inodes, 200804 blocks\r\n 10040 blocks (5.00%) reserved for the super user\r\n First data block=0\r\n Maximum filesystem blocks=209715200\r\n 7 block groups\r\n 32768 blocks per group, 32768 fragments per group\r\n 14368 inodes per group\r\n Superblock backups stored on blocks: \r\n 32768, 98304, 163840\r\n\r\nWriting inode tables: done \r\n Writing superblocks and filesystem accounting information: done\r\n\r\nThis filesystem will be automatically checked every 32 mounts or\r\n 180 days, whichever comes first. Use tune2fs -c or -i to override.\r\n<\/pre>\n

\u5728sdb6\u4e0a\u5efa\u7acbext3\u5206\u533a<\/p>\n

\r\n[root@linuxidc ~]# mkfs.ext3 \/dev\/sdb6\r\n mke2fs 1.39 (29-May-2006)\r\n Filesystem label=\r\n OS type: Linux\r\n Block size=4096 (log=2)\r\n Fragment size=4096 (log=2)\r\n 217280 inodes, 433747 blocks\r\n 21687 blocks (5.00%) reserved for the super user\r\n First data block=0\r\n Maximum filesystem blocks=444596224\r\n 14 block groups\r\n 32768 blocks per group, 32768 fragments per group\r\n 15520 inodes per group\r\n Superblock backups stored on blocks: \r\n 32768, 98304, 163840, 229376, 294912\r\n\r\nWriting inode tables: done \r\n Creating journal (8192 blocks): done\r\n Writing superblocks and filesystem accounting information: done\r\n\r\nThis filesystem will be automatically checked every 32 mounts or\r\n 180 days, whichever comes first. Use tune2fs -c or -i to override.\r\n [root@linuxidc ~]#\r\n<\/pre>\n

\u5efa\u7acb\u4e24\u4e2a\u76ee\u5f55\/Oracle\u548c\/web\uff0c\u5c06\u65b0\u5efa\u597d\u7684\u4e24\u4e2a\u5206\u533a\u6302\u8f7d\u5230\u7cfb\u7edf<\/p>\n

\r\n[root@linuxidc ~]# mkdir \/oracle\r\n [root@linuxidc ~]# mkdir \/web\r\n [root@linuxidc ~]# mount \/dev\/sdb1 \/oracle\r\n [root@linuxidc ~]# mount \/dev\/sdb6 \/web\r\n<\/pre>\n

\u67e5\u770b\u5206\u533a\u6302\u8f7d\u60c5\u51b5<\/p>\n

\r\n[root@linuxidc ~]# df -h\r\n\u6587\u4ef6\u7cfb\u7edf \u5bb9\u91cf \u5df2\u7528 \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9\r\n\/dev\/mapper\/VolGroup00-LogVol00\r\n 6.7G 2.8G 3.6G 44% \/\r\n \/dev\/sda1 99M 12M 82M 13% \/boot\r\n tmpfs 125M 0 125M 0% \/dev\/shm\r\n\/dev\/sdb1 773M 808K 733M 1% \/oracle\r\n \/dev\/sdb6 1.7G 35M 1.6G 3% \/web\r\n<\/pre>\n

\u5982\u679c\u9700\u8981\u6bcf\u6b21\u5f00\u673a\u81ea\u52a8\u6302\u8f7d\u5219\u9700\u8981\u4fee\u6539\/etc\/fstab\u6587\u4ef6\uff0c\u52a0\u5165\u4e24\u884c\u914d\u7f6e<\/p>\n

\r\n[root@linuxidc ~]# vim \/etc\/fstab\r\n\r\n\/dev\/VolGroup00\/LogVol00 \/ ext3 defaults 1 1\r\n LABEL=\/boot \/boot ext3 defaults 1 2\r\n tmpfs \/dev\/shm tmpfs defaults 0 0\r\n devpts \/dev\/pts devpts gid=5,mode=620 0 0\r\n sysfs \/sys sysfs defaults 0 0\r\n proc \/proc proc defaults 0 0\r\n \/dev\/VolGroup00\/LogVol01 swap swap defaults 0 0\r\n\/dev\/sdb1 \/oracle ext2 defaults 0 0\r\n \/dev\/sdb6 \/web ext3 defaults 0 0\r\n<\/pre>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.linuxidc.com\/Linux\/2018-08\/153580.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/xiangjie-linux-ygf.html<\/a>\u7f16\u8f91\uff1a\u738b\u5065\u8fbe\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

disk\u662fLinux\u81ea\u5e26\u7684\u786c\u76d8\u5206\u533a\u5de5\u5177\uff0c\u53ef\u4ee5\u5bf9\u786c\u76d8\u8fdb\u884c\u5206\u533a\uff0c\u6216\u8005\u5bf9\u786c\u76d8\u5206\u533a\u8fdb\u884c\u8c03\u6574\u3002 \u9996\u5148\u9009\u62e9\u8981\u8fdb\u884c\u64cd\u4f5c\u7684\u78c1\u76d8 […]<\/p>\n","protected":false},"author":1893,"featured_media":116498,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-116484","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/116484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1893"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=116484"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/116484\/revisions"}],"predecessor-version":[{"id":116499,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/116484\/revisions\/116499"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/116498"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=116484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=116484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=116484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}