WARNING: Re-reading the partition table failed with error 22: Invalid argument

来源:http://www.cnblogs.com/kerrycode/archive/2017/05/18/6874479.html
-Advertisement-
Play Games

在劃分磁碟分區時,遇到錯誤“WARNING: Re-reading the partition table failed with error 22: Invalid argument” 如下所示: [root@DB-Server u02]# fdisk -l Disk /dev/sda: 500.... ...


在劃分磁碟分區時,遇到錯誤“WARNING: Re-reading the partition table failed with error 22: Invalid argument” 如下所示:

[root@DB-Server u02]# fdisk -l
 
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       60801   488279610   8e  Linux LVM
[root@DB-Server u02]# fdisk /dev/sda2
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
 
 
The number of cylinders for this disk is set to 60788.
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)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 
Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1-60788, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60788, default 60788): 
Using default value 60788
 
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 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.

 

image

 

出現這個錯誤,是因為沒有在有效的設備(valid device)上進行分區操作(太久沒有玩這台測試伺服器了,忘記當初如何劃分存儲,測試一個備份的過程急於需要磁碟空間,沒有檢查情況,就動手了),實際上這個分區類型為 Linux LVM。已經劃給VolGroup00了。後續處理如下。

 

[root@DB-Server ~]# pvscan
  PV /dev/sda2   VG VolGroup00   lvm2 [465.66 GB / 413.94 GB free]
  Total: 1 [465.66 GB] / in use: 1 [465.66 GB] / in no VG: 0 [0   ]
[root@DB-Server ~]# lvscan
  ACTIVE            '/dev/VolGroup00/LogVol00' [45.97 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [5.75 GB] inherit
[root@DB-Server ~]# more /etc/fstab 
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
[root@DB-Server ~]# vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               465.66 GB
  PE Size               32.00 MB
  Total PE              14901
  Alloc PE / Size       1655 / 51.72 GB
  Free  PE / Size       13246 / 413.94 GB
  VG UUID               EYKFmq-O1Ko-0z94-Os3P-AKfC-0bG9-9oTQDh
   
[root@DB-Server ~]# lvextend -L 80G /dev/VolGroup00/LogVol00
  Extending logical volume LogVol00 to 80.00 GB
  Logical volume LogVol00 successfully resized
[root@DB-Server ~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/LogVol00 to 20971520 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol00 is now 20971520 blocks long.
 
[root@DB-Server ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       78G   32G   42G  44% /
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                 1.9G 1023M  916M  53% /dev/shm
/tmp/rhel-server-5.7-x86_64-dvd.iso
                      3.6G  3.6G     0 100% /mnt/cdrom
[root@DB-Server ~]# 

 

clip_image002


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • ———————————————————————————————————————————— 中斷的過程: 對於單片機來講,中斷是指CPU在處理某一時間A時,發生了另一事件B請求CPU立刻去處理(中斷發生);CPU暫時停止當前的工作(中斷響應),轉而去處理事件B(中斷服務),待CPU處理事件B完成後,再 ...
  • 一、下載安裝 Windows下載地址: http://www.apachehaus.com/cgi-bin/download.plx 根據系統版本選擇 下載後,解壓到C盤Apache 文件夾,從命令行進入到Apace的bin目錄,輸入 httpd -k install 完成安裝。 二、配置 修改Ap ...
  • ———————————————————————————————————————————— 定時/計數器結構(T0和T1) 16位寄存器T0、T1分別由TH0、TL0和TH1、TL1四個8位計數器組成 定時器的區別: T0可分成2個獨立的8位定時器,而定時器1則不能; T1可作為串口的波特率發生器,而 ...
  • ———————————————————————————————————————————— 定時器中斷應用實例 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ...
  • 一、準備工作 : 1、下載Windows Server 2008,把iso鏡像文件裡面的文件全部解壓到硬碟,比如D:/win2008。 2、下載好WinPE,製作好U盤啟動盤。 二、準備安裝: 1、開機設置從U盤啟動,進入WinPE。 2、以NTFS格式格式化C盤,然後把D:/win2008裡面的“ ...
  • a.安裝mysql database 1.安裝mysql服務端 sudo apt-get install mysql-server (在此過程中要求為mysql的root用戶設置一個密碼) 2.安裝mysql客戶端 sudo apt-get install mysql-client 3.安裝mysq ...
  • 一、在指定目錄創建腳本並賦予755許可權 vim /etc/init.d/tomcat 二、在tomcat的配置文件中添加相應參數 vim /usr/local/tomcat/bin/catalina.sh 三、添加tomcat為系統服務並指定在個各個控制台為開機啟動模式 chkconfig --ad ...
  • 編程語言介紹 語言是人與人之間溝通的介質,簡單的來說,編程語言也是語言,是我們程式員與電腦溝通的介質。常見的編程語言有我們熟知的做網頁開發的php,寫安卓應用的java,應用廣泛的c、c#及c++,以及目前火熱的python、r、go等高級語言,另外還有最接地氣的低級語言彙編語言,但是無論何種語言 ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...