Linux 系统超2T扩容挂载
Last updated
2023-01-28 10:31:28
{"value":"\u672c\u6587\u6863\u4ee5centos7.6\u4e3a\u4f8b\u6dfb\u52a0\u4e00\u5757\u540d\u4e3asda\u7684\u8d852T\u6570\u636e\u76d8\u6269\u5bb9\u6302\u8f7d\uff0c\u5bf9\u5927\u90e8\u5206linux\u7cfb\u7edf\u9002\u7528\uff0c\u9488\u5bf9\u6570\u636e\u76d8\u7684\u64cd\u4f5c\u5efa\u8bae\u5148\u5bf9\u6570\u636e\u8fdb\u884c\u5907\u4efd\u9632\u6b62\u6570\u636e\u4e22\u5931\n\n### 1.\u67e5\u770b\u78c1\u76d8\u60c5\u51b5\n**\u6253\u5f00\u63a7\u5236\u53f0\u6216\u8fdc\u7a0b\u8fde\u63a5\u60a8\u7684\u670d\u52a1\u5668\uff0c\u8f93\u5165lsblk\u67e5\u770b\u60a8\u7684\u78c1\u76d8\u60c5\u51b5**\n> [root@CDNcloud ~]# lsblk\n> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT\n> sda 8:00 3T 0 disk \n> sr0 11:01 1024M 0 rom \n> vda253:00 50G 0 disk \n> \u2514\u2500vda1 253:10 50G 0 part \/\n\n\u53ef\u4ee5\u770b\u5230\u76ee\u524d\u9700\u8981\u6302\u8f7d\u7684\u6570\u636e\u76d8sda\u67093T\u7684\u5bb9\u91cf\u3002\n\n### 2.\u8fdb\u5165parted\n\n * parted \/dev\/sda\uff08\u8981\u6302\u8f7d\u7684\u78c1\u76d8\u540d\uff09\n\n \t mklabel gpt\uff08\u5c06\u786c\u76d8\u683c\u5f0f\u8f6c\u6362\u6210gpt\u683c\u5f0f\uff09\n \t\n \t print \u8f93\u51fa\u76ee\u524d\u786c\u76d8\u683c\u5f0f\u60c5\u51b5\uff0c\u5728partition table\u540e\u770b\u5230\u662fgpt\u683c\u5f0f\u5c31\u8f6c\u6362\u6210\u529f\u4e86\u3002\n \t\n \t quit\u9000\u51faparted*\n\n> [root@CDNcloud ~]# parted \/dev\/sda\n> GNU Parted 3.1\n> \u4f7f\u7528 \/dev\/sda\n> Welcome to GNU Parted! Type 'help' to view a list of commands.\n> (parted) \n> (parted) mklabel gpt \n> (parted) print\n> Model: QEMU QEMU HARDDISK (scsi)\n> Disk \/dev\/sda: 3299GB\n> Sector size (logical\/physical): 512B\/512B\n> Partition Table: gpt\n> Disk Flags: \n>\n> Number Start End Size File system Name \u6807\u5fd7\n>\n> (parted) quit \n> \u4fe1\u606f: You may need to update \/etc\/fstab.\n\n### 3.\u521d\u59cb\u5316sda\u76d8\n**\u521d\u59cb\u5316sda\u76d8\uff0c\u8f93\u5165 mkfs -t ext4 \/dev\/sda\uff08\u8981\u6269\u5bb9\u7684\u78c1\u76d8\u540d\uff09\u4e4b\u540e\u8f93\u5165y**\n\n> [root@CDNcloud ~]# mkfs -t ext4 \/dev\/sda\n> mke2fs 1.42.9 (28-Dec-2013)\n> \/dev\/sda is entire device, not just one partition!\n> \u65e0\u8bba\u5982\u4f55\u4e5f\u8981\u7ee7\u7eed? (y,n) y\n> Discarding device blocks: \u5b8c\u6210\n> \u6587\u4ef6\u7cfb\u7edf\u6807\u7b7e=\n> OS type: Linux\n> \u5757\u5927\u5c0f=4096 (log=2)\n> \u5206\u5757\u5927\u5c0f=4096 (log=2)\n> Stride=0 blocks, Stripe width=0 blocks\n> 201326592 inodes, 805306368 blocks\n> 40265318 blocks (5.00%) reserved for the super user\n> \u7b2c\u4e00\u4e2a\u6570\u636e\u5757=0\n> Maximum filesystem blocks=2952790016\n> 24576 block groups\n> 32768 blocks per group, 32768 fragments per group\n> 8192 inodes per group\n> Superblock backups stored on blocks: \n> 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, \n> 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, \n> 102400000, 214990848, 512000000, 550731776, 644972544\n>\n> Allocating group tables: \u5b8c\u6210\n> \u6b63\u5728\u5199\u5165inode\u8868: \u5b8c\u6210\n> Creating journal (32768 blocks): \u5b8c\u6210\n> Writing superblocks and filesystem accounting information: \u5b8c\u6210 \n\n### 4.\u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d\n**\u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d\uff0c\u9700\u8981\u4fee\u6539\u542f\u52a8\u9879\uff0c\u8f93\u5165 echo \/dev\/sda \/home ext4 defaults 0 0 >> \/etc\/fstab \u5c06sda \u6302\u8f7d\u5728home \u76ee\u5f55\u4e0b**\n\u7528\u6237\u53ef\u4ee5\u6309\u7167\u81ea\u5df1\u7684\u9700\u6c42\u51b3\u5b9a\u6302\u8f7d\u7684\u76ee\u5f55\u3002\n\n> [root@CDNcloud ~]# echo \/dev\/sda \/home ext4 defaults 0 0 >\/etc\/fstab\n\n### 5.\u68c0\u67e5\u547d\u4ee4\n**\u67e5\u770b\u542f\u52a8\u9879\u6587\u4ef6\u7684\u540e\u4e24\u884c tail -2 \/etc\/fstab \u53ef\u4ee5\u770b\u5230\u547d\u4ee4\u5df2\u5199\u5165\u6587\u4ef6**\n> [root@CDNcloud ~]# tail -2 \/etc\/fstab\n> UUID=2197b385-bfd6-43b6-ba79-18a760fbe562 \/ xfs defaults0 0\n> \/dev\/sda \/home ext4 defaults 0 0\n\n### 6.\u518d\u6b21\u67e5\u770b\u78c1\u76d8\u60c5\u51b5\n**\u8f93\u5165reboot \u91cd\u542f\u7cfb\u7edf \u4e4b\u540e\u767b\u5165\u7cfb\u7edf\u540e\uff0c\u8f93\u5165lsblk\u67e5\u770b\u78c1\u76d8\u60c5\u51b5\uff0c\u53ef\u4ee5\u770b\u5230sda\u5df2\u987a\u5229\u6302\u8f7d\u5230\/home \u76ee\u5f55**\n> [root@CDNcloud ~]# lsblk\n> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT\n> sda 8:003T 0 disk \/home\n> sr0 11:01 1024M 0 rom \n> vda253:00 50G 0 disk \n> \u2514\u2500vda1 253:10 50G 0 part \/"}