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

简介: 在划分磁盘分区时,遇到错误“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 ~]# 

 

相关文章
|
存储 安全 数据安全/隐私保护
特权账号管理系统,全方位的账号安全平台
如今,企业特权账户范围广、数量大且极不稳定是现代企业面临黑客等攻击行为的最大安全隐患。而且,由于特权账户的权限极大,一旦其被攻击者破解,就能完全掌控组织的IT基础设施,从而引发防护控制失效、机密数据泄露、商业诈骗和扰乱企业正常运作的严重后果。
378 0
|
机器学习/深度学习 人工智能 Cloud Native
云原生场景中的 AI任务调度
PAI平台参加“周二开源日”活动,本期分享核心内容摘要 一、AI任务的需求与DLC 二、KubeDL 三、KubeDLPro 四、总结
1984 0
云原生场景中的 AI任务调度
|
7月前
|
数据采集 SQL 人工智能
告别数据混乱:瓴羊Dataphin 通过AI+标准让企业数据“活”起来 | 【瓴羊数据荟】数据MeetUp第四期
AI技术的快速发展促使企业重新审视数据治理的重要性。当前,企业在数据治理中常因指标口径不统一、数据血缘不透明等问题陷入困境。阿里云智能集团瓴羊高级技术专家周鑫提出,以数据标准为核心贯穿数据全生命周期,可有效解决治理难题。
380 15
告别数据混乱:瓴羊Dataphin 通过AI+标准让企业数据“活”起来 | 【瓴羊数据荟】数据MeetUp第四期
|
11月前
|
监控 Unix Linux
|
12月前
|
缓存 负载均衡 算法
nginx学习:配置文件详解,负载均衡三种算法学习,上接nginx实操篇
Nginx 是一款高性能的 HTTP 和反向代理服务器,也是一个通用的 TCP/UDP 代理服务器,以及一个邮件代理服务器和通用的 HTTP 缓存服务器。
565 0
nginx学习:配置文件详解,负载均衡三种算法学习,上接nginx实操篇
|
存储 缓存 算法
Vulkan 围炉夜话5
Vulkan 围炉夜话
190 4
|
安全 网络安全 算法框架/工具
欧拉系统出现 algorithm negotiation fail 错误解决
【5月更文挑战第5天】欧拉系统出现 algorithm negotiation fail 错误解决
2154 3
|
Java Go
Golang深入浅出之-Go语言指针面试必知:理解与使用指针
【4月更文挑战第21天】Go语言中的指针允许直接操作内存,常用于高效数据共享和传递。本文介绍了指针的基础知识,如声明、初始化和解引用,以及作为函数参数使用。此外,讨论了`new()`与`make()`的区别和内存逃逸分析。在结构体上下文中,指针用于减少复制开销和直接修改对象。理解指针与内存管理、结构体的关系及常见易错点,对于面试和编写高性能Go代码至关重要。
362 2
|
数据可视化 搜索推荐 vr&ar
增强现实(AR)技术在教育领域的应用研究
增强现实(AR)技术在教育领域的应用研究
564 0