{"id":1356,"date":"2023-11-20T18:23:06","date_gmt":"2023-11-20T10:23:06","guid":{"rendered":"https:\/\/www.izhuhn.cn\/?p=1356"},"modified":"2023-11-20T18:23:06","modified_gmt":"2023-11-20T10:23:06","slug":"linux%e7%a3%81%e7%9b%98%e5%88%86%e5%8c%ba%e8%a1%a8%e6%8d%9f%e5%9d%8f%e5%85%b6%e4%b8%ad%e4%b8%80%e4%b8%aa%e5%88%86%e5%8c%ba%e5%8f%aa%e6%98%be%e7%a4%ba1k","status":"publish","type":"post","link":"https:\/\/www.izhuhn.cn\/index.php\/2023\/11\/20\/linux%e7%a3%81%e7%9b%98%e5%88%86%e5%8c%ba%e8%a1%a8%e6%8d%9f%e5%9d%8f%e5%85%b6%e4%b8%ad%e4%b8%80%e4%b8%aa%e5%88%86%e5%8c%ba%e5%8f%aa%e6%98%be%e7%a4%ba1k\/","title":{"rendered":"Linux\u78c1\u76d8\u5206\u533a\u8868\u635f\u574f\u5176\u4e2d\u4e00\u4e2a\u5206\u533a\u53ea\u663e\u793a1K"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u9898\u63cf\u8ff0<\/h3>\n\n\n\n<p>\u865a\u62df\u673a\u5f02\u5e38\u4e0b\u7535\uff0c\u91cd\u65b0\u5f00\u673a\u540e\u5176\u4e2d\u4e00\u4e2a\u78c1\u76d8\u7684\u4e00\u4e2a\u5206\u533a\u53ea\u67091KiB<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5904\u7406\u6b65\u9aa4<\/h3>\n\n\n\n<p>1\u3001\u6267\u884clsblk\u67e5\u770b\u5206\u533a\u60c5\u51b5\uff0c\u663e\u793a\u53ea\u67091kb<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@test ~]# lsblk\nNAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT\nsda           8:0    0   30G  0 disk \n\u251c\u2500sda1        8:1    0  600M  0 part \/boot\/efi\n\u251c\u2500sda2        8:2    0    1G  0 part \/boot\n\u2514\u2500sda3        8:3    0 28.4G  0 part \n  \u251c\u2500cs-root 253:0    0 25.4G  0 lvm  \/\n  \u2514\u2500cs-swap 253:1    0    3G  0 lvm  &#91;SWAP]\nsdb           8:16   0  500G  0 disk \n\u251c\u2500sdb1        8:17   0   20G  0 part \n\u2514\u2500sdb2        8:18   0    1K  0 part <\/code><\/pre>\n\n\n\n<p>2\u3001\u6267\u884ctune2fs\u67e5\u8be2\u5206\u533a\u8be6\u7ec6\u4fe1\u606f\uff0c\u63d0\u793a\u65e0\u6cd5\u6253\u5f00\u5206\u533a\u6709\u8d85\u7ea7\u574f\u5757<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@test ~]# tune2fs -l \/dev\/sdb2 \r\ntune2fs 1.45.6 (20-Mar-2020)\r\ntune2fs: Attempt to read block from filesystem resulted in short read while trying to open \/dev\/sdb2\r\nCouldn't find valid filesystem superblock.\r<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>3\u3001\u6267\u884c make2fs -n \u5c1d\u8bd5\u67e5\u8be2\u5907\u7528\u8d85\u7ea7\u5757\uff0c\u4f9d\u65e7\u63d0\u793a\u5931\u8d25<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@test ~]# mke2fs  -n \/dev\/sdb2 \r\nmke2fs 1.45.6 (20-Mar-2020)\r\nFound a dos partition table in \/dev\/sdb2\r\nProceed anyway? (y,N) y\r\nmke2fs: inode_size (128) * inodes_count (0) too big for a\r\n\tfilesystem with 0 blocks, specify higher inode_ratio (-i)\r\n\tor lower inode count (-N).<\/code><\/pre>\n\n\n\n<p>4\u3001\u4f7f\u7528fdisk\u67e5\u770b\u5206\u533a\u8868\u770b\u603b\u4f53\u662f\u6b63\u5e38\u7684\uff0c\u4f46\u9488\u5bf9\u5355\u5206\u533a\u662f\u5f02\u5e38\u7684<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@test ~]# fdisk  -l \/dev\/sdb \nDisk \/dev\/sdb: 500 GiB, 536870912000 bytes, 1048576000 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 4096 bytes\nI\/O size (minimum\/optimal): 4096 bytes \/ 4096 bytes\nDisklabel type: dos\nDisk identifier: 0x6b9fc1d1\n\nDevice     Boot    Start      End  Sectors Size Id Type\n\/dev\/sdb1           2048 41945087 41943040  20G 83 Linux\n\/dev\/sdb2       41945088 1048575999 1006630912  480G 83 Linux\n\n&#91;root@test ~]# fdisk  -l \/dev\/sdb1\nDisk \/dev\/sdb1: 20 GiB, 21474836480 bytes, 41943040 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 4096 bytes\nI\/O size (minimum\/optimal): 4096 bytes \/ 4096 bytes\n\n&#91;root@test ~]# fdisk  -l \/dev\/sdb2\nDisk \/dev\/sdb2: 1 KiB, 1024 bytes, 2 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 4096 bytes\nI\/O size (minimum\/optimal): 4096 bytes \/ 4096 bytes\nDisklabel type: dos\nDisk identifier: 0x00000000\n<\/code><\/pre>\n\n\n\n<p>5\u3001\u7ecf\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\u67e5\u8be2\u5224\u65ad\u4e3a\u6574\u5757\u78c1\u76d8\u7684\u524d512\u5b57\u8282\u5206\u533a\u8868\u4e22\u5931\u4e00\u5c0f\u90e8\u5206\u6570\u636e\uff0c\u521a\u597d\u4e22\u5931\u7684\u6570\u636e\u662f\u5728sdb2\u5206\u533a\u8868\u4e2d\uff0c\u5907\u4efd\u78c1\u76d8\u540e\u5c1d\u8bd5\u4f7f\u7528\u5206\u533a\u5de5\u5177\u91cd\u65b0\u5206\u533a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@test ~]# fdisk \/dev\/sdb\n\nWelcome to fdisk (util-linux 2.32.1).\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\n\nCommand (m for help): p\nDisk \/dev\/sdb: 500 GiB, 536870912000 bytes, 1048576000 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 4096 bytes\nI\/O size (minimum\/optimal): 4096 bytes \/ 4096 bytes\nDisklabel type: dos\nDisk identifier: 0x6b9fc1d1\n\nDevice     Boot    Start      End  Sectors Size Id Type\n\/dev\/sdb1           2048 41945087 41943040  20G 83 Linux\n\/dev\/sdb2       41945088 1048575999 1006630912  480G 83 Linux\r\n\nCommand (m for help): d\nPartition number (1,2, default 2): 2\n\nPartition 2 has been deleted.\n\nCommand (m for help): w\nThe partition table has been altered.\nCalling ioctl() to re-read partition table.\nSyncing disks.\n\n=======================\u2191\u5220\u9664\u5206\u533a\u540e\u4fdd\u5b58\u518d\u91cd\u65b0\u521b\u5efa\n\n&#91;root@test ~]# fdisk \/dev\/sdb\n\nWelcome to fdisk (util-linux 2.32.1).\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\n\nCommand (m for help): n\nPartition type\n   p   primary (1 primary, 0 extended, 3 free)\n   e   extended (container for logical partitions)\nSelect (default p): e\nPartition number (2-4, default 2): 2   \nFirst sector (41945088-1048575999, default 41945088):41945088 \nLast sector, +sectors or +size{K,M,G,T,P} (41945088-1048575999, default 1048575999):\n\nCreated a new partition 2 of type 'Extended' and of size 480 GiB.\n\nCommand (m for help): w\nThe partition table has been altered.\nCalling ioctl() to re-read partition table.\nSyncing disks.\n=======================\u6ce8\u610f\u4e0d\u7528\u683c\u5f0f\u5316<\/code><\/pre>\n\n\n\n<p>6\u3001\u5c1d\u8bd5\u6302\u8f7d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@test ~]# mount \/dev\/sdb2  \/mnt\r\n\u6210\u529f\u6ca1\u6709\u62a5\u9519<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u9898\u590d\u73b0<\/h3>\n\n\n\n<p>\u7ecf\u8fc7\u95ee\u9898\u5f97\u5904\u7406\u57fa\u672c\u4e0a\u786e\u5b9a\u662f\u5206\u533a\u8868\u4e22\u5931\u4e86\u4e00\u90e8\u5206\u5173\u4e8esdb2\u7684\u5206\u533a\u8868\u4fe1\u606f\uff0c\u6240\u4ee5\u6bd4\u8f83\u597d\u6d6e\u73b0\uff0c\u76f4\u63a5\u4f7f\u7528dd\u547d\u4ee4\u5c06\u5206\u533a\u524d512\u5b57\u8282\u62b9\u9664\u4e00\u5c0f\u6bb5\u6570\u636e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#dd if=\/dev\/zero of=\/dev\/sdb bs=1 skip=420 count=92<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u63cf\u8ff0 \u865a\u62df\u673a\u5f02\u5e38\u4e0b\u7535\uff0c\u91cd\u65b0\u5f00\u673a\u540e\u5176\u4e2d\u4e00\u4e2a\u78c1\u76d8\u7684\u4e00\u4e2a\u5206\u533a\u53ea\u67091KiB \u5904\u7406\u6b65\u9aa4 1\u3001\u6267\u884clsblk\u67e5\u770b\u5206\u533a\u60c5\u51b5\uff0c\u663e\u793a\u53ea\u67091kb  &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1356"}],"collection":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1356"}],"version-history":[{"count":11,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1356\/revisions"}],"predecessor-version":[{"id":1367,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1356\/revisions\/1367"}],"wp:attachment":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}