当前位置:网站首页 / Linux / 正文

MycoRin香港NAT机使用全部硬盘容量教程

时间:2018年07月14日 | 作者 : liuhui | 分类 : Linux | 浏览: 6375次 | 评论 0

阿里云限量代金券 | 此广告位出租25元/月

博士前几天买了台MycoRin的NAT小机,硬盘是20GB的,但是查看分区大小只有3.4G,下面就来告诉大家如何将MycoRin小机硬盘的所有容量利用起来。

[root@hka ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/vda1       3.4G  2.2G  1.1G  68% /

devtmpfs        234M     0  234M   0% /dev

tmpfs           244M     0  244M   0% /dev/shm

tmpfs           244M   13M  232M   6% /run

tmpfs           244M     0  244M   0% /sys/fs/cgroup

tmpfs            49M     0   49M   0% /run/user/0


罗列分区信息我们发现其实硬盘是21.5G的

[root@hka ~]# fdisk -l


Disk /dev/vda: 21.5 GB, 21474836480 bytes, 41943040 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x00095886


   Device Boot      Start         End      Blocks   Id  System

/dev/vda1   *        2048    40892031    20444992   83  Linux

/dev/vda2        40892032    41940607      524288   82  Linux swap / Solaris


检查文件系统

[root@hka ~]# e2fsck -f /dev/vda1

e2fsck 1.42.9 (28-Dec-2013)

/dev/vda1 is mounted.

e2fsck: Cannot continue, aborting.


变更文件系统大小

[root@hka ~]# resize2fs /dev/vda1

resize2fs 1.42.9 (28-Dec-2013)

Filesystem at /dev/vda1 is mounted on /; on-line resizing required

old_desc_blocks = 1, new_desc_blocks = 3

The filesystem on /dev/vda1 is now 5111248 blocks long.


再查看分区时我们发现硬盘容量已经增加了

[root@hka ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/vda1        20G  2.2G   17G  12% /

devtmpfs        234M     0  234M   0% /dev

tmpfs           244M     0  244M   0% /dev/shm

tmpfs           244M   13M  232M   6% /run

tmpfs           244M     0  244M   0% /sys/fs/cgroup

tmpfs            49M     0   49M   0% /run/user/0

推荐您阅读更多有关于“”的文章

猜你喜欢

网站分类
关注电脑博士
友情链接

分享:

支付宝

微信