主机自带硬盘超过300GB,目前只划分使用了3个主分区,不到70GB,如 下:

[root@db2 ~]# df -h 
Filesystem Size Used Avail Use% Mounted on 
/dev/sda1 29G 3.7G  24G 14% / 
/dev/sda2 29G  22G 5.2G 81% /oracle 
tmpfs    2.0G    0 2.0G  0% /dev/shm

[root@db2 ~]# cat /proc/partitions
major minor  #blocks  name

8     0  311427072 sda
    sda1
   8     2   30716280 sda2
   8     3    8193150 sda3
   8    16     976896 sdb
   8    32     976896 sdc

现在需要给系统添加1个100GB的空间存放数据文件,而又不影响现有系统上业务的运行,
使用fdisk结合partprobe命令不重启系统添加 一块新的磁盘分区。操作步骤如下:


第1步,添加新的磁盘分区 
[root@db2 ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 38770.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 318.9 GB, 318901321728 bytes
255 heads, 63 sectors/track, 38770 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3824    30716248+  83  Linux
/dev/sda2            3825        7648    30716280   83  Linux
/dev/sda3            7649        8668     8193150   82  Linux swap / Solaris

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Selected partition 4
First cylinder (8669-38770, default 8669):
Using default value 8669
Last cylinder or +size or +sizeM or +sizeK (8669-38770, default 38770): +100G   
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.
Syncing disks.
[root@db2 ~]#

第2步,使用工具partprobe让kernel读取分区信息 
[root@db2 ~]# partprobe
使用fdisk工具只是将分区信息写到磁盘,如果需要mkfs磁盘分区则需要重启系统,
而使用partprobe则可以使kernel重新读取分区 信息,从而避免重启系统。

第3步,格式化文件系统 
[root@db2 ~]# mkfs.ext3 /dev/sda4
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
12222464 inodes, 24416791 blocks
1220839 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
746 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 
    2654208, 4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:

done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@db2 ~]#

第4步,mount新的分区/dev/sda4 
[root@db2 ~]# e2label  /dev/sda4 /data
[root@db2 ~]# mkdir /data
[root@db2 ~]# mount /dev/sda4 /data
[root@db2 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1             29753556   3810844  24406900  14% /
/dev/sda2             29753588  11304616  16913160  41% /oracle
tmpfs                  2023936         0   2023936   0% /dev/shm
/dev/sda4             96132968    192312  91057300   1% /data
[root@db2 ~]#

linux partprobe命令相关推荐

  1. Linux partprobe命令详解

    partprobe命令 partprobe: 通知系统分区表的变化 常用的命令展示: 查看帮助 [root@localhost omc]# partprobe --help Usage: partpr ...

  2. linux 格式化未分配区间,Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令...

    安装操作系统的时候,有一部分空间没有使用,在系统安装后,准备重新分区并格式化,在挂到/u01下,来安装Oracle的. 分区的过程正常: [root@db1 /]# fdisk -l Disk /de ...

  3. linux 新分区使用1%,linux下使用fdisk结合partprobe命令不重启系统添加一块新的磁盘分区...

    主机自带硬盘超过300GB,目前只划分使用了3个主分区,不到70GB,如 下: [root@db2 ~]# df -h Filesystem Size Used Avail Use% Mounted ...

  4. Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令

    分区的过程正常: [root@db1 /]# fdisk -l Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/trac ...

  5. partprobe命令--Linux命令应用大词典729个命令解读

    内容来源于人民邮电出版社<Linux命令应用大词典> 讲述729个命令,1935个例子 学习Linux系统的参考书.案头书,遇到不懂的命令或命令选项一查即可 争取每天都发布内容 本文出自 ...

  6. linux读取 第一个分区 命令,partprobe命令

    partprobe命令用于重读分区表,当出现删除文件后,出现仍然占用空间.可以partprobe在不重启的情况下重读分区. 语法partprobe(选项)(参数) 选项-d:不更新内核: -s:显示摘 ...

  7. linux part用法,Linux下partprobe命令的使用详解

    linux上,在安装系统之后,可否创建分区并且在不重新启动机器的情况下系统能够识别这些分区? 解决方法: 你可以使用一个叫做partprobe的工具.它包含在parted的rpm软件包中.在Red H ...

  8. partprobe使用方法_教程方法;linux下使用fdisk结合partprobe命令不重启系统添加一块新的磁盘分区电脑技巧-琪琪词资源网...

    琪琪词资源网-教程方法;linux下使用fdisk结合partprobe命令不重启系统添加一块新的磁盘分区电脑技巧,以下是给大家带来的教程方法;linux下使用fdisk结合partprobe命令不重 ...

  9. linux格式化时设备或资源忙,Linux下用fdisk命令和partprobe命令不重启系统新建分区并格式化...

    由于工作的需要,最近一段时间一直在学习Linux.学习一门新的知识,我是喜欢根据谋一本书或者某一个学习视频系统的学习,这样可以对学习的新知识有一个系统全面的认识和了解.所以学习之前,买了一本鸟哥的私房 ...

最新文章

  1. 在新的标签页中代开编辑文件
  2. 后端码农谈前端(HTML篇)第三课:常见属性
  3. JAVA EE 6 jar包集合_Java EE6将JSF facelets(xhtml)和ManagedBeans打包成JAR
  4. Cisco 交换机EC 捆绑
  5. rhel5.3服务器安装centOS的yum源
  6. Sqlalchemy 乱码解决方法
  7. 【Python】爬取xici和快代理的免费代理ip
  8. 学习了金字塔原理中的SCQA分析法
  9. 大规模电生理网络动力学
  10. 为了防止火灾发生,安科瑞余压监控系统在某高层住宅的应用方案
  11. 大厂Offer拿到手软啊!技术详细介绍
  12. 蓝牙耳机选哪种的比较好、高端蓝牙耳机推荐
  13. 在线客服服务干货:如何与客户进行有效沟通?
  14. 涉外资(外商)公司股权转让有关问题答疑
  15. Unbuntu18.04系统定制化制作与再生龙镜像生成
  16. Linux 查看服务器几核几G
  17. 基于C#弹幕类射击游戏的实现——(十)整合
  18. 中国古代哲学书籍目录
  19. Kubernetes 1.22.9搭建 和 部署dashboard可视化UI
  20. java steam_Java 8 Steam 例子整理

热门文章

  1. iOS -- block one
  2. 【信息系统项目管理师】论信息系统项目的整体管理(论文攻略篇)
  3. try/catch语句
  4. Ping32企业员工聊天软件及记录管控
  5. 苹果6s上市时间_苹果给6s出“福利”,网友:同期的安卓手机都馋哭了
  6. 如何使用计算机防病毒,如何使用Windows Defender定期扫描计算机同时使用另一个防病毒...
  7. 重装系统(二):进入BIOS并了解其界面相关信息
  8. deepin设置ll命令
  9. Android截取视频帧并转化为Bitmap示例
  10. 锐龙r5 4500u和i7 10510u 的区别