linux在3T的分区磁盘上追加空间
整块磁盘容量有3000G,其中2000G已经分给了vdb1分区,剩余1000G,现在需要把这1000G扩容到vdb1分区。
[root@dn236 datatom]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 197G 70G 119G 37% /
devtmpfs 9.8G 0 9.8G 0% /dev
tmpfs 9.8G 0 9.8G 0% /dev/shm
tmpfs 9.8G 18M 9.8G 1% /run
tmpfs 9.8G 0 9.8G 0% /sys/fs/cgroup
tmpfs 1.9G 0 1.9G 0% /run/user/1020
/dev/vdb1 2.0T 33G 2.0T 2% /mnt
[root@dn236 datatom]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 200G 0 disk
└─vda1 253:1 0 200G 0 part /
vdb 253:16 0 3T 0 disk
└─vdb1 253:17 0 2T 0 part /mnt
- 使用df -Th 命令查看文件系统类型,在Type列输出,xfs或者ext4.
- 关闭所有使用 /mnt 的服务并卸载该分区的挂载点,umount /mnt
若提示磁盘忙,fuser -m -v /mnt 以及 lsof |grep /mnt 找出正在使用磁盘的进程,并结束掉 - 使用fdisk 命令重新调整磁盘分区大小
fdisk -l
fdisk /dev/vdb
p #查看Start 磁柱号,并记录
g #创建一个新的空的GPT分区表,此时’p’再查看,原本的分区被清理掉了,磁盘头部的MBR分区表清除和替换为GPT分区表,实际上系统文件没有被破坏。
n #创建新分区
p #主分区
1 #第一个分区(创建分区时需要注意,开始的磁柱号要和原来的一致,结束的磁柱号可以直接回车使用全部磁盘)
wq #保存退出,
partprobe 使其操作不用重启生效。
[root@dn236 datatom]# fdisk /dev/vdbWARNING: The size of this disk is 3.2 TB (3221225472000 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).Welcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Command (m for help): pDisk /dev/vdb: 3221.2 GB, 3221225472000 bytes, 6291456000 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: 0x7f0b0907Device Boot Start End Blocks Id System
/dev/vdb1 2048 4194303999 2097150976 83 LinuxCommand (m for help): m
Command actiona toggle a bootable flagb edit bsd disklabelc toggle the dos compatibility flagd delete a partitiong create a new empty GPT partition tableG create an IRIX (SGI) partition tablel list known partition typesm print this menun add a new partitiono create a new empty DOS partition tablep print the partition tableq quit without saving changess create a new empty Sun disklabelt change a partition's system idu change display/entry unitsv verify the partition tablew write table to disk and exitx extra functionality (experts only)Command (m for help):
Command (m for help): g
Building a new GPT disklabel (GUID: 730494AF-154C-4B45-AB97-5B14AC0F3F56)Command (m for help): pDisk /dev/vdb: 3221.2 GB, 3221225472000 bytes, 6291456000 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: gpt
Disk identifier: 730494AF-154C-4B45-AB97-5B14AC0F3F56# Start End Size Type NameCommand (m for help): w
The partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@dn236 datatom]# fdisk /dev/vdb
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Welcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-6291455966, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-6291455966, default 6291455966):
Created partition 1Command (m for help): pDisk /dev/vdb: 3221.2 GB, 3221225472000 bytes, 6291456000 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: gpt
Disk identifier: 730494AF-154C-4B45-AB97-5B14AC0F3F56# Start End Size Type Name1 2048 6291455966 3T Linux filesyste Command (m for help): w
The partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
- 查看分区情况
对于 xfs : xfs_repair /dev/vdb1 #检查分区,遇错修复,
xfs_growfs /dev/vdb1 #调整分区大小
对于 ext4 : e2fsck -f /dev/vdb1 #检查分区,遇错修复,
resize2fs /dev/vdb1 #调整分区大小
[root@dn236 datatom]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 200G 0 disk
└─vda1 253:1 0 200G 0 part /
vdb 253:16 0 3T 0 disk
└─vdb1 253:17 0 2T 0 part /mnt
[root@dn236 datatom]#
[root@dn236 datatom]#
[root@dn236 datatom]# partprobe
[root@dn236 datatom]#
[root@dn236 datatom]#
[root@dn236 datatom]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 200G 0 disk
└─vda1 253:1 0 200G 0 part /
vdb 253:16 0 3T 0 disk
└─vdb1 253:17 0 3T 0 part /mnt
- 重新挂载分区 mount /mnt,查看分区
[root@dn236 datatom]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 197G 70G 119G 37% /
devtmpfs 9.8G 0 9.8G 0% /dev
tmpfs 9.8G 0 9.8G 0% /dev/shm
tmpfs 9.8G 18M 9.8G 1% /run
tmpfs 9.8G 0 9.8G 0% /sys/fs/cgroup
tmpfs 1.9G 0 1.9G 0% /run/user/1020
/dev/vdb1 3.0T 33G 2.9T 2% /mnt
linux在3T的分区磁盘上追加空间相关推荐
- linux 挂载3t硬盘分区,Ubuntu挂载3T硬盘或大于2T磁盘的方法
1.显示硬盘及所属分区情况.在终端窗口中输入如下命令 fdisk -lu 可以看到要挂在的3t磁盘 因fdisk分区最大只能2t,所以这里使用parted来分区. 执行命令parted /dev/sd ...
- linux 挂载3t硬盘分区,centos7挂载3T硬盘
相信很多人都遇到大硬盘无法全部格式化空间的问题,这里给大家说下怎么完全使用2T以上的硬盘空间.(这篇文章其实早就写好了的,因操作的时候没截图,一直没找到机会把图补上,所以大家降就看吧) 系统:cent ...
- 如何查看linux的分区类型,linux 下查看硬盘分区类型
可以用 df 这个命令 具体 要 man df 仔细看看 实例 [root@localhost mnt]# df -Th 文件系统 类型 容量 已用 可用 已用% 挂载点 /d ...
- linux启动项目报连不上mysql_Linux运维常见故障及处理的 32 个妙计
作为Linux运维,多多少少会碰见这样那样的问题或故障,从中总结经验,查找问题,汇总并分析故障的原因,这是一个Linux运维工程师良好的习惯.每一次技术的突破,都经历着苦闷,伴随着快乐,可我们还是执着 ...
- linux对已有分区进行扩容
linux对已有分区进行扩容,解决报错:设备文件不存在(No such file or directory) 本文介绍 步骤一:查看磁盘结构以及大小 步骤二:删除多余分区(视情况而定) 步骤三:创建新 ...
- linux挂载硬盘_CentOS「linux」学习笔记12:磁盘管理、分区挂载卸载操作
linux基础操作:主要介绍了磁盘管理.分区挂载卸载操作. 特别说明linux中磁盘表现形式: IDE硬盘在linux中表示方式为"hdx".SCSI硬盘在linux中表示方式为& ...
- centos 卸载_CentOS「linux」学习笔记12:磁盘管理、分区挂载卸载操作
linux基础操作:主要介绍了磁盘管理.分区挂载卸载操作. 特别说明linux中磁盘表现形式: IDE硬盘在linux中表示方式为"hdx".SCSI硬盘在linux中表示方式为& ...
- linux df是否分区,Linux中df命令查询磁盘信息和fdisk命令分区的用法
df - 报告文件系统磁盘空间的使用情况 总览 df [option]... [file]... posix 选项: [-kp] gnu 选项 (最短方式): [-ahhiklmpv] [-t fst ...
- linuxquot;/quot;分区名称,linux分区,磁盘系统的管理,文件系统制作
最近又开始重新拾起linux了,因为工作中用的很少,所以看得东西很容易就忘记了. 这几天看了下linux的分区,以及如何制作文件系统等相关命令的用法,下面就按照这个流程来讲一讲,免得自己日后忘记了. ...
最新文章
- python raw_input 与 input 的区别
- 小程序webview不全屏_有赞微信商城和有赞微信小程序什么不一样
- PAT (Basic Level) Practice (中文)1023 组个最小数 (20 分) (排序)
- GIAC 2020 全球互联网架构大会演讲实录:基于TarsGo的微服务技术架构实践
- mysql用户_MySQL用户权限管理详解
- SpringCloud企业实战专栏
- (30)VHDL实现比较器(有符号)
- 基于matlab的升压斩波实验,升降压斩波电路matlab仿真
- java swing 显示图片_Swing显示图片
- essay--网页播放器代码大全
- 2022吴恩达机器学习第二周
- ept技术_速懂X86虚拟化关键概念 - Intel EPT
- Linux WIFI模块驱动移植
- .dwg(sw)-exb
- HIT-ICS大作业-程序人生Hello‘s P2P
- 从智慧家庭到智慧社区,海尔为地产精装房智能化标准提供样本
- Windows下如何配置tomcat环境变量
- openssl命令查看证书有效期_kubeadm初始化k8s集群延长证书过期时间
- 只有程序员才懂得的梗!
- 虚荣服务器维护,老牌MOBA手游《虚荣》走入历史,最后的中国服务器即将关闭...