<span id="vexk9"><table id="vexk9"></table></span>

      partprobe

      不重啟的情況下重讀分區

      補充說明

      partprobe命令 用于重讀分區表,當出現刪除文件后,出現仍然占用空間??梢詐artprobe在不重啟的情況下重讀分區。

      語法

      partprobe(選項)(參數)
      

      選項

      -d:不更新內核;
      -s:顯示摘要和分區;
      -h:顯示幫助信息;
      -v:顯示版本信息。
      

      參數

      設備:指定需要確認分區表改變的硬盤對應的設備文件。

      實例

      使用partprobe不重啟系統添加新的磁盤分區,主機自帶硬盤超過300GB,目前只劃分使用了3個主分區,不到70GB,如下:

      [root@localhost ~]# 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@localhost ~]# cat /proc/partitions
      major minor  #blocks  name
      
         8     0  311427072 sda
         8     1   30716248 sda1
         8     2   30716280 sda2
         8     3    8193150 sda3
         8    16     976896 sdb
         8    32     976896 sdc
      
      …省略其他
      

      現在需要給系統添加1個100GB的空間存放數據文件,而又不影響現有系統上業務的運行,使用fdisk結合partprobe命令不重啟系統添加一塊新的磁盤分區。操作步驟如下:

      第1步 添加新的磁盤分區

      [root@localhost ~]# 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.
      

      第2步 使用工具partprobe讓kernel讀取分區信息:

      [root@localhost ~]# partprobe
      

      使用fdisk工具只是將分區信息寫到磁盤,如果需要mkfs磁盤分區則需要重啟系統,而使用partprobe則可以使kernel重新讀取分區信息,從而避免重啟系統。

      第3步 格式化文件系統:

      [root@localhost ~]# 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@localhost ~]#
      

      第4步 mount新的分區/dev/sda4

      [root@localhost ~]# e2label  /dev/sda4 /data
      [root@localhost ~]# mkdir /data
      [root@localhost ~]# mount /dev/sda4 /data
      [root@localhost ~]# 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
      

      使用partprobe可以不用重啟系統即可配合fdisk工具創建新的分區。

      主站蜘蛛池模板: 一本久久知道综合久久| 久久亚洲欧洲国产综合| 久久婷婷五月综合97色一本一本| 亚洲AV综合色区无码一区爱AV| 浪潮AV色综合久久天堂| 一本色道久久88—综合亚洲精品| | 亚洲国产成人久久综合一区| 久久婷婷成人综合色综合| 99久久婷婷免费国产综合精品| 在线综合亚洲中文精品| 久久婷婷五月综合97色直播| 色婷婷六月亚洲综合香蕉| 日韩欧国产精品一区综合无码| 国产精彩对白综合视频| 色综合久久久久综合体桃花网| 色老头综合免费视频| 99久久国产综合精品女图图等你| 久久本道综合久久伊人| 小说区综合区首页| 一本色道久久88—综合亚洲精品| 亚洲国产综合专区在线电影| 伊人色综合一区二区三区| 五月婷婷亚洲综合| 色噜噜狠狠狠狠色综合久| 亚洲国产综合人成综合网站00| 色欲香天天天综合网站| 婷婷四房综合激情五月在线| 久久精品国产9久久综合| 综合在线视频精品专区| 亚洲乱码中文字幕综合| 99热婷婷国产精品综合| 狠狠综合久久AV一区二区三区| 国产综合免费精品久久久| 狠狠色狠狠色综合网| 久久综合色天天久久综合图片 | 色99久久久久高潮综合影院| 成人伊人亚洲人综合网站222| 天啪天天久久天天综合啪| 一本一本久久a久久精品综合| 亚洲狠狠爱综合影院婷婷|