内容简介:Fedora 29 前两天已经 Final Freeze 了,准备从 Fedora 28 升级到 Fedora 29 。 之前创建虚拟机时,硬盘设置的有点小 upgrade 这种操作空间不够用,在 VMware 中把虚机硬盘扩容至查看当前分区的删除旧分区:
Fedora 29 前两天已经 Final Freeze 了,准备从 Fedora 28 升级到 Fedora 29 。 之前创建虚拟机时,硬盘设置的有点小 upgrade 这种操作空间不够用,在 VMware 中把虚机硬盘扩容至 8 GiB
。 虚拟机
只有一个 /
分区
,后面调整磁盘分区,拉伸文件系统,需要在 LiveOS 环境进行操作, 下载了一个 netinst ISO 安装镜像,重启引导进入安装 LiveOS 环境。
调整分区
查看当前分区的 起始位置 和 分区标记 ( Flags ) :
[anaconda root@localhost /]# parted /dev/sda GNU Parted 3.2 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 8590MB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 5369MB 5368MB primary ext4 boot
删除旧分区:
(parted) rm 1 (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 8590MB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags
从原分区的 起始位置 开始新建 主分区 至 最大可用空间 :
(parted) mkpart primary 1049kB 100% (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 8590MB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 8590MB 8589MB primary lba
重新创建分区后,之前的 分区标记
Flags
丢失,重新设置 boot
不然无法启动:
(parted) set 1 boot on (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 8590MB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 8590MB 8589MB primary boot, lba (parted) set 1 lba off (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 8590MB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 8590MB 8589MB primary boot (parted) q Information: You may need to update /etc/fstab.
文件系统自检
分区调整好后,使用 e2fsck
自检
分区上的文件系统:
[anaconda root@localhost /]# e2fsck -fv /dev/sda1 e2fsck 1.44.3 (10-July-2018) Superblock last write time is in the future. (by less than a day, probably due to the hardware clock being incorrectly set) Pass 1: Checking inodes, blocks, and sizes Inode 138584 extent tree (at level 1) could be shorter. Fix<y>? yes Inode 282934 extent tree (at level 1) could be shorter. Fix<y>? yes Pass 1E: Optimizing extent trees Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information fedora-root: ***** FILE SYSTEM WAS MODIFIED ***** 141558 inodes used (43.20%, out of 327680) 2435 non-contiguous files (1.7%) 149 non-contiguous directories (0.1%) # of inodes with ind/dind/tind blocks: 0/0/0 Extent depth histogram: 127429/623/1 1106492 blocks used (84.44%, out of 1310464) 0 bad blocks 1 large file 111258 regular files 15944 directories 0 character device files 0 block device files 0 fifos 11243 links 14347 symbolic links (13497 fast symbolic links) 0 sockets ------------ 152792 files
文件系统扩容
使用 resize2fs
对文件系统进行拉伸:
[anaconda root@localhost /]# resize2fs /dev/sda1 resize2fs 1.44.3 (10-July-2018) Resizing the filesystem on /dev/sda1 to 2096896 (4k) blocks. The filesystem on /dev/sda1 is now 2096896 (4k) blocks long.
使用 dumpe2fs
确认文件系统大小: How to find the size of a filesystem ?
# echo 1024*1024*1024|bc 1073741824 # dumpe2fs -h /dev/sda1 |& awk -F: '/Block count/{count=$2} /Block size/{size=$2} END{print count*size/1073741824}' 7.99902
也可以挂载 /dev/sda1
到 /mnt
查看大小:
[anaconda root@localhost /]# mount /dev/sda1 /mnt [anaconda root@localhost /]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 482M 1 loop loop1 7:1 0 2G 1 loop ├─live-rw 253:0 0 2G 0 dm / └─live-base 253:1 0 2G 1 dm loop2 7:2 0 32G 0 loop └─live-rw 253:0 0 2G 0 dm / sda 8:0 0 8G 0 disk └─sda1 8:1 0 8G 0 part /mnt sr0 11:0 1 594M 0 rom /run/install/repo
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 一文读懂区块链链上扩容和链下扩容
- golang内存扩容
- Sharding扩容方案-2(实现)
- golang 切片扩容的探讨
- VirtualBox 虚拟机磁盘扩容
- VirtualBox中Ubuntu扩容
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Google成功的七堂课
罗耀宗 / 电子工业出版社 / 2005-7 / 28.00元
Google是全球使用人数最多的搜索引擎,在短短几年内,Google从斯坦福大学的实验室,茁壮成长为举世瞩目的IT业超级巨人,他们的成功绝非偶然,尤其是在网络泡沫破灭,行业一片萧条之际,它的崛起更为IT业带来一缕曙光。作者从趋势观察家的角度,以讲座的形式,向读者讲述Google成功的关键因素:破除因循守旧、不断打破常规,核心技术领先、做出了“更好的捕鼠器”,使得Google在搜索技术方面远远超越对......一起来看看 《Google成功的七堂课》 这本书的介绍吧!