5\u3001 \u78c1\u76d8\u5206\u533a\u5de5\u5177fdisk<\/strong><\/div>\nfdisk\u662f\u9488\u5bf9\u78c1\u76d8\u5bb9\u91cf\u5c0f\u4e8e2T<\/p>\n
[root@cairui ~]# fdisk --help\r\nfdisk: invalid option -- '-'\r\n\r\nfdisk: Usage:\r\nfdisk [options] change partition table\r\nfdisk [options] -l list partition table(s)\r\nfdisk -s give partition size(s) in blocks\r\n\r\nOptions:\r\n-b sector size (512, 1024, 2048 or 4096)\r\n-c switch off DOS-compatible mode\r\n-h print help\r\n-u give sizes in sectors instead of cylinders\r\n-v print version\r\n-C specify the number of cylinders\r\n-H specify the number of heads\r\n-S specify the number of sectors per track\r\n\r\n: Success\r\n<\/pre>\n<\/p>\n
[root@localhost ~]# fdisk \/dev\/sda1\u3000\u3000#\u5bf9\/dev\/sda1\u8fdb\u884c\u5206\u533a\u64cd\u4f5c\r\nDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel\r\nBuilding a new DOS disklabel with disk identifier 0x02fadd9c.\r\nChanges will remain in memory only, until you decide to write them.\r\nAfter that, of course, the previous content won't be recoverable.\r\n\r\nWarning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)\r\n\r\nWARNING: DOS-compatible mode is deprecated. It's strongly recommended to\r\nswitch off the mode (command 'c') and change display units to\r\nsectors (command 'u').\r\n\r\nCommand (m for help): m\r\nCommand action\r\na toggle a bootable flag\r\nb edit bsd disklabel\r\nc toggle the dos compatibility flag\r\nd delete a partition\u3000\u3000#\u5220\u9664\u4e00\u4e2a\u5206\u533a\r\nl list known partition types\r\nm print this menu\r\nn add a new partition\u3000\u3000#\u65b0\u5efa\u4e00\u4e2a\u5206\u533a\r\no create a new empty DOS partition table\r\np print the partition table\u3000\u3000#\u6253\u5370\u51fa\u5206\u533a\u8868\u4fe1\u606f\r\nq quit without saving changes\u3000\u3000#\u4e0d\u4fdd\u5b58\u9000\u51fa\r\ns create a new empty Sun disklabel\r\nt change a partition's system id\r\nu change display\/entry units\r\nv verify the partition table\r\nw write table to disk and exit\u3000\u3000#\u5c06\u5206\u533a\u4fe1\u606f\u5199\u5165\u5206\u533a\u8868\u5e76\u9000\u51fa\u7a0b\u5e8f\r\nx extra functionality (experts only)\r\n<\/pre>\nCommand action\r\ne extended\r\np primary partition (1-4)\r\np\r\nPartition number (1-4): 1\r\nFirst cylinder (1-2610, default 1): \u8bbe\u7f6e\u8d77\u59cb\u67f1\u9762\r\nUsing default value 1\r\nLast cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610):\r\n\u8bbe\u7f6e\u5927\u5c0f\u6216\u67f1\u9762\r\nUsing default value 2610\r\nCommand (m for help): m\r\nCommand action\r\na toggle a bootable flag\r\nb edit bsd disklabel\r\nc toggle the dos compatibility flag\r\nd delete a partition\r\nl list known partition types\r\nm print this menu\r\nn add a new partition\r\no create a new empty DOS partition table\r\np print the partition table\r\nq quit without saving changes\r\ns create a new empty Sun disklabel\r\nt change a partition's system id\r\nu change display\/entry units\r\nv verify the partition table\r\nw write table to disk and exit\r\nx extra functionality (experts only)\r\nCommand (m for help): w\r\nThe partition table has been altered!\r\nCalling ioctl() to re-read partition table.\r\nSyncing disks.\r\nCommand (m for help): p \u6253\u5370\u5206\u533a\u8868\u4fe1\u606f\r\nDisk \/dev\/sdb: 21.5 GB, 21474836480 bytes\r\n255 heads, 63 sectors\/track, 2610 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\n121 \/ 753\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0xb712cc55\r\nDevice Boot Start End Blocks Id System\r\n\/dev\/sdb1 1 2610 20964793+ 83 Linux\r\n\u5206\u533a\u5b8c\u6210\u540e\u6267\u884c partprobe \u901a\u77e5\u7cfb\u7edf\u5206\u533a\u8868\u53d1\u751f\u6539\u53d8\r\n\u63a5\u4e0b\u6765\u8fdb\u884c\u683c\u5f0f\u5316\u5206\u533a\r\n[root@Centos ~]# mkfs.ext3 \/dev\/sdb1\r\nmke2fs 1.41.12 (17-May-2010)\r\nFilesystem label=\r\nOS type: Linux\r\nBlock size=4096 (log=2)\r\nFragment size=4096 (log=2)\r\nStride=0 blocks, Stripe width=0 blocks\r\n1310720 inodes, 5241198 blocks\r\n262059 blocks (5.00%) reserved for the super user\r\nFirst data block=0\r\nMaximum filesystem blocks=4294967296\r\n160 block groups\r\n32768 blocks per group, 32768 fragments per group\r\n8192 inodes per group\r\nSuperblock backups stored on blocks:\r\n32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,\r\n4096000\r\nWriting inode tables: done\r\nCreating journal (32768 blocks): done\r\nWriting superblocks and filesystem accounting information: done\r\nThis filesystem will be automatically checked every 24 mounts or\r\n180 days, whichever comes first. Use tune2fs -c or -i to override.\r\n[root@Centos ~]# tune2fs -c -1 \/dev\/sdb1\r\ntune2fs 1.41.12 (17-May-2010)\r\nSetting maximal mount count to -1\r\n[root@Centos ~]# mount \/dev\/sdb1 \/mnt \u6302\u8f7d\u5206\u533a\u81f3\/mnt \u4e0b\r\n[root@Centos ~]# df -h\r\nFilesystem Size Used Avail Use% Mounted on\r\n\/dev\/mapper\/VolGroup-lv_root 50G 3.5G 44G 8% \/\r\ntmpfs 932M 0 932M 0% \/dev\/shm\r\n\/dev\/sda1 485M 39M 421M 9% \/boot\r\n122 \/ 753\r\n\/dev\/mapper\/VolGroup-lv_home 26G 215M 24G 1% \/home\r\n\/dev\/sdb1 20G 172M 19G 1% \/mnt\r\n<\/pre>\n6\u3001 \u78c1\u76d8\u5206\u533a\u5de5\u5177parted<\/strong><\/div>\n\u7531\u4e8e\u73af\u5883\u9650\u5236\u65e0\u6cd5\u67092T\u6216\u8005\u4ee5\u4e0a\u5927\u5c0f\u7684\u78c1\u76d8\uff0c\u53ea\u80fd\u6a21\u62df\u73af\u5883\u6765\u4f7f\u7528parted\u5206\u533a\u5de5\u5177\u6765\u8fdb\u884c\u5206\u533a<\/p>\n
[root@Centos ~]# parted \/dev\/sdb mklabel gpt\r\n\u5c06\u78c1\u76d8\u8f6c\u6362\u6210 gpt \u7684\u683c\u5f0f\r\n[root@Centos ~]# parted \/dev\/sdb mkpart primary 0 200\uff08200M\uff09\r\nWarning: The resulting partition is not properly aligned for best\r\nperformance.\r\nIgnore\/Cancel? Ignore\r\n[root@Centos ~]# parted \/dev\/sdb p \u6253\u5370\u5206\u533a\u8868\u4fe1\u606f\r\nModel: VMware, VMware Virtual S (scsi)\r\nDisk \/dev\/sdb: 1074MB\r\nSector size (logical\/physical): 512B\/512B\r\nPartition Table: gpt\r\nNumber Start End Size File system Name Flags\r\n1 17.4kB 200MB 200MB primary\r\n[root@Centos ~]# parted \/dev\/sdb mkpart primary 201 1073\r\n\u5206\u533a\u5e76\u8bbe\u7f6e\u5927\u5c0f\r\nInformation: You may need to update \/etc\/fstab.\r\n[root@Centos ~]# parted \/dev\/sdb p \u6253\u5370\u5206\u533a\u8868\u4fe1\u606f\r\nModel: VMware, VMware Virtual S (scsi)\r\nDisk \/dev\/sdb: 1074MB\r\nSector size (logical\/physical): 512B\/512B\r\nPartition Table: gpt\r\nNumber Start End Size File system Name Flags\r\n1 17.4kB 200MB 200MB primary\r\n2 201MB 1073MB 871MB primary\r\n[root@Centos ~]# mkfs.ext4 \/dev\/sdb1\r\nmke2fs 1.41.12 (17-May-2010)\r\nFilesystem label=\r\nOS type: Linux\r\nBlock size=1024 (log=0)\r\nFragment size=1024 (log=0)\r\n123 \/ 753\r\nStride=0 blocks, Stripe width=0 blocks\r\n48960 inodes, 195296 blocks\r\n9764 blocks (5.00%) reserved for the super user\r\nFirst data block=1\r\nMaximum filesystem blocks=67371008\r\n24 block groups\r\n8192 blocks per group, 8192 fragments per group\r\n2040 inodes per group\r\nSuperblock backups stored on blocks:\r\n8193, 24577, 40961, 57345, 73729\r\nWriting inode tables: done\r\nCreating journal (4096 blocks): done\r\nWriting superblocks and filesystem accounting information: done\r\nThis filesystem will be automatically checked every 36 mounts or\r\n180 days, whichever comes first. Use tune2fs -c or -i to override.\r\n[root@Centos ~]# tune2fs -c -1 \/dev\/sdb1\r\ntune2fs 1.41.12 (17-May-2010)\r\nSetting maximal mount count to -1\r\n[root@Centos ~]# mount \/dev\/sdb1 \/mnt\r\n[root@Centos ~]# df -h\r\nFilesystem Size Used Avail Use% Mounted on\r\n\/dev\/mapper\/VolGroup-lv_root 50G 3.5G 44G 8% \/\r\ntmpfs 932M 0 932M 0% \/dev\/shm\r\n\/dev\/sda1 485M 39M 421M 9% \/boot\r\n\/dev\/mapper\/VolGroup-lv_home 26G 215M 24G 1% \/home\r\n\/dev\/sdb1 185M 5.6M 170M 4% \/mnt\r\n<\/pre>\n[root@cairui ~]# parted --help\r\nUsage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\r\nApply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run in\r\ninteractive mode.\r\n\r\nOPTIONs:\r\n-h, --help displays this help message\r\n-l, --list lists partition layout on all block devices\r\n-m, --machine displays machine parseable output\r\n-s, --script never prompts for user intervention\r\n-v, --version displays the version\r\n-a, --align=[none|cyl|min|opt] alignment for new partitions\r\n\r\nCOMMANDs:\r\nalign-check TYPE N check partition N for TYPE(min|opt)\r\nalignment\r\ncheck NUMBER do a simple check on the file system\r\ncp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition\r\nhelp [COMMAND] print general help, or help on\r\nCOMMAND\r\nmklabel,mktable LABEL-TYPE create a new disklabel (partition\r\ntable)\r\nmkfs NUMBER FS-TYPE make a FS-TYPE file system on\r\npartition NUMBER\r\nmkpart PART-TYPE [FS-TYPE] START END make a partition\r\nmkpartfs PART-TYPE FS-TYPE START END make a partition with a file system\r\nmove NUMBER START END move partition NUMBER\r\nname NUMBER NAME name partition NUMBER as NAME\r\nprint [devices|free|list,all|NUMBER] display the partition table,\r\navailable devices, free space, all found partitions, or a particular\r\npartition\r\nquit exit program\r\nrescue START END rescue a lost partition near START\r\nand END\r\nresize NUMBER START END resize partition NUMBER and its file\r\nsystem\r\nrm NUMBER delete partition NUMBER\r\nselect DEVICE choose the device to edit\r\nset NUMBER FLAG STATE change the FLAG on partition NUMBER\r\ntoggle [NUMBER [FLAG]] toggle the state of FLAG on partition\r\nNUMBER\r\nunit UNIT set the default unit to UNIT\r\nversion display the version number and\r\ncopyright information of GNU Parted\r\n<\/pre>\n\n\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.cnblogs.com\/caicairui\/p\/8422251.html<\/a><\/p>\n\u672c\u6587\u5730\u5740\uff1a http:\/\/lrxjmw.cn\/linux-system-disk.html<\/a>\u7f16\u8f91\uff1a\u51af\u745e\u6d9b\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"\u5bfc\u8bfb \u6240\u6709\u6709\u7cfb\u7edf\u90fd\u4e00\u6837\uff0c\u90fd\u662f\u4e00\u79cd\u8f6f\u4ef6\u88ab\u5b89\u88c5\u4e8e\u67d0\u4e2a\u786c\u4ef6\u4e4b\u4e0a\uff0c\u8fd9\u4e2a\u786c\u4ef6\u65e0\u5916\u975e\u662f\u4e00\u79cd\u5b58\u50a8\u8bbe\u5907\uff0c\u901a\u5e38\u64cd\u4f5c\u7cfb\u7edf\u90fd\u662f\u5b89\u88c5\u5728 […]<\/p>\n","protected":false},"author":1329,"featured_media":94920,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-94905","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\/94905","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\/1329"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=94905"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/94905\/revisions"}],"predecessor-version":[{"id":291276,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/94905\/revisions\/291276"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/94920"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=94905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=94905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=94905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}