linux partprobe命令

linux partprobe命令主机自带硬盘超过 300GB 目前只划分使用了 3 个主分区 不到 70GB 如下 root db2 df h nbsp FilesystemSi Mountedon nbsp dev sda129G3 7G nbsp 24G14 nbsp dev sda229G nbsp 22G5 2G81 oracle nbsp tmpfs nbsp nbsp nbsp 2 0G nbsp nbsp nbsp 02 0G nbsp 0 dev


第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, 8 bytes
255 heads, 63 sectors/track, 38770 cylinders
Units = cylinders of 16065 * 512 = bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3824    +  83  Linux
/dev/sda2            3825        7648       83  Linux
/dev/sda3            7649        8668        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)
inodes, blocks
blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=
746 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, , , , , , , 
    , , , , ,

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                    14% /
/dev/sda2                   41% /oracle
tmpfs                           0      0% /dev/shm
/dev/sda4                      1% /data
[root@db2 ~]#


























































































版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/176515.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月26日 下午9:44
下一篇 2026年3月26日 下午9:45


相关推荐

  • 图片二分类在VGG16基础上finetune

    图片二分类在VGG16基础上finetunecoding utf 8 Createdon DATE TIME author importtorchi preparemodel vgg16 torchvision models vgg16 pretrained True 设置网络参数 读取输入特征的维度 num fc model1 vgg16 classifier 6 in features 修改最后一层的输出维度 即分类数

    2026年3月20日
    2
  • CQRS架构

    CQRS架构命令查询的责任分离 CommandQuery 简称 CQRS 模式是一种架构体系模式 能够使改变模型的状态的命令和模型状态的查询实现分离 这属于 DDD 应用领域的一个模式 为了使得项目逻辑更加清晰 便于对不同部分进行针对性的优化 一 背景问题在以前的管理系统中 命令 Command 通常用来更新数据 操作 DB 和查询 Query 通常使用

    2026年3月19日
    2
  • tar压缩和解压文件或文件夹

    1. 使用tar压缩文件tar-zcvftest.tar.gz./test/该命令表示压缩当前文件夹下的文件夹test,压缩后缀名为test.tar.gz如果不需要压缩成gz,只需要后缀为tar格式的,那么输入如下命令:tar-cvftest.tar./test/ 2. 使用tar解压文件tar-xzvftest.tar.gz  该命令表示把后缀为….

    2022年4月3日
    90
  • 匹配追踪算法的原理

    匹配追踪算法的原理

    2026年3月15日
    2
  • 详解SpringBoot整合Redis

    详解SpringBoot整合RedisSpringBoot 整合 Redis 在 SpringBoot 中一般使用 RedisTemplat 提供的方法来操作 Redis 那么使用 SpringBoot 整合 Redis 需要那些步骤呢 1 JedisPoolCon 这个是配置连接池 2 RedisConnect 这个是配置连接信息 这里的 RedisConnect 是一个接口 我们需要使用它的实

    2026年3月19日
    2
  • ubuntu 硬盘安装图解

    ubuntu 硬盘安装图解br MaverickMeer 10 启用了全新的安装程序 使得整个安装过程不但焕然一新 对那些不太熟悉 Linux 环境的用户来说也更容易使用了 br 在安装过程中 用户可以下载软件更新 安装无线网卡官方驱动 并完成对 MP3 音频文件 AdobeFlashPl 播放器 Java DVD 播放的支持 br 下面说说在 WindowsXP 系统下硬盘安装 Ubuntu10 10 双系统的全程图解 安装很快 30 分钟不到就能安装好 br 1 首先下

    2025年11月8日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号