LVM XFS增加硬盘分区容量(resize2fs: Bad magic number in super-block while)

 LVM XFS增加硬盘分区容量(resize2fs: Bad magic number in super-block while) 2015-09-04 11:28:01

分类: Linux

LVM XFS增加硬盘分区容量(resize2fs: Bad magic number in super-block while)
给某个硬盘增加分区之后
[[email protected]-213-66 ~]# df -h
Filesystem                            Size  Used Avail Use% Mounted on
/dev/mapper/vg_mysql0121366-LogVol02  7.7G  2.6G  4.8G  36% /
tmpfs                                 495M     0  495M   0% /dev/shm
/dev/sda1                             194M   29M  155M  16% /boot
/dev/mapper/vg_mysql0121366-LogVol01  8.0G  3.1G  5.0G  38% /data
这里增加/data大小
[[email protected]-213-66 ~]# fdisk -l /dev/sda

Disk /dev/sda: 40.8 GB, 40802189312 bytes
255 heads, 63 sectors/track, 4960 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000eb81f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        2350    18668544   8e  Linux LVM

进行分区
[[email protected]-213-66 ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to
         switch off the mode (command ‘c‘) and change display units to
         sectors (command ‘u‘).

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (2350-4960, default 2350):
Using default value 2350
Last cylinder, +cylinders or +size{K,M,G} (2350-4960, default 4960):
Using default value 4960

Command (m for help): p

Disk /dev/sda: 40.8 GB, 40802189312 bytes
255 heads, 63 sectors/track, 4960 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000eb81f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        2350    18668544   8e  Linux LVM
/dev/sda3            2350        4960    20966832   83  Linux

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)

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 or after you run partprobe(8) or kpartx(8)
Syncing disks.

重启服务器或者 partprobe
创建物理卷
[[email protected]-213-66 ~]# pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created
使用vgscan查询物理卷
[[email protected]-213-66 ~]# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_mysql0121366" using metadata type lvm2
使用新增物理卷扩展vg
[[email protected]-213-66 ~]# vgextend vg_mysql0121366 /dev/sda3
  Volume group "vg_mysql0121366" successfully extended
[[email protected]-213-66 ~]# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_mysql0121366" using metadata type lvm2
  查询vg
[[email protected]-213-66 ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_mysql0121366
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               37.79 GiB
  PE Size               4.00 MiB
  Total PE              9675
  Alloc PE / Size       4557 / 17.80 GiB
  Free  PE / Size       5118 / 19.99 GiB
  VG UUID               Zy2PVv-xSsx-NEAv-L6ba-G8Oy-tBBq-5zXKQm
 查询lv
[[email protected]-213-66 ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg_mysql0121366/LogVol01
  LV Name                LogVol01
  VG Name                vg_mysql0121366
  LV UUID                5znkJ2-wdeZ-Y2o1-ECDS-gzzl-PqaS-qo2yZR
  LV Write Access        read/write
  LV Creation host, time Mysql01-213-66, 2015-08-30 20:42:13 +0800
  LV Status              available
  # open                 1
  LV Size                8.00 GiB
  Current LE             2048
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Path                /dev/vg_mysql0121366/LogVol00
  LV Name                LogVol00
  VG Name                vg_mysql0121366
  LV UUID                b1FV1n-iKyK-kZ23-glRO-opFh-gDRp-TzWNcL
  LV Write Access        read/write
  LV Creation host, time Mysql01-213-66, 2015-08-30 20:42:14 +0800
  LV Status              available
  # open                 1
  LV Size                2.00 GiB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vg_mysql0121366/LogVol02
  LV Name                LogVol02
  VG Name                vg_mysql0121366
  LV UUID                eoVdk3-cbcP-9PlI-kZBL-6pY2-Jpbl-1WI2uH
  LV Write Access        read/write
  LV Creation host, time Mysql01-213-66, 2015-08-30 20:42:14 +0800
  LV Status              available
  # open                 1
  LV Size                7.80 GiB
  Current LE             1997
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

[[email protected]-213-66 ~]# df -h
Filesystem                            Size  Used Avail Use% Mounted on
/dev/mapper/vg_mysql0121366-LogVol02  7.7G  2.6G  4.8G  35% /
tmpfs                                 495M     0  495M   0% /dev/shm
/dev/sda1                             194M   29M  155M  16% /boot
/dev/mapper/vg_mysql0121366-LogVol01  8.0G  3.1G  5.0G  38% /data
扩展lv
[[email protected]-213-66 ~]# lvextend -L +19G /dev/mapper/vg_mysql0121366-LogVol01
  Extending logical volume LogVol01 to 27.00 GiB
  Logical volume LogVol01 successfully resized
[[email protected]-213-66 ~]# df -h
Filesystem                            Size  Used Avail Use% Mounted on
/dev/mapper/vg_mysql0121366-LogVol02  7.7G  2.6G  4.8G  35% /
tmpfs                                 495M     0  495M   0% /dev/shm
/dev/sda1                             194M   29M  155M  16% /boot
/dev/mapper/vg_mysql0121366-LogVol01  8.0G  3.1G  5.0G  38% /data
若不是xfs我们可以用resize2fs,这里报错了
[[email protected]-213-66 ~]# resize2fs -f /dev/mapper/vg_mysql0121366-LogVol01
resize2fs 1.41.12 (17-May-2010)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/vg_mysql0121366-LogVol01
Couldn‘t find valid filesystem superblock.
[[email protected]213-66 ~]# xfs_growfs /dev/mapper/vg_mysql0121366-LogVol01
meta-data=/dev/mapper/vg_mysql0121366-LogVol01 isize=256    agcount=4, agsize=524288 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=2097152, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 2097152 to 7077888
[[email protected]-213-66 ~]# df -h
Filesystem                            Size  Used Avail Use% Mounted on
/dev/mapper/vg_mysql0121366-LogVol02  7.7G  2.6G  4.8G  35% /
tmpfs                                 495M     0  495M   0% /dev/shm
/dev/sda1                             194M   29M  155M  16% /boot
/dev/mapper/vg_mysql0121366-LogVol01   27G  3.1G   24G  12% /data
时间: 2024-10-16 10:22:56

LVM XFS增加硬盘分区容量(resize2fs: Bad magic number in super-block while)的相关文章

WinXP下如何巧妙修改硬盘分区容量

在使用Windows的时候经常因为分区分的理想感觉非常烦恼,想将数据有条理的放置起来就是因为分区不合适最后东西放的乱七八糟,结果过段时间就找不到想要的文件了,其实系统盘C盘要是不动的话,其他磁盘分区都可以在XP系统啊解决.下面就介绍一下方法. 强调: 1.不能调整系统盘. 2.被调整盘上的数据会全部丢失(可先移至不重分的盘).操作步骤: 1.关闭所有应用程序,打开“控制面板”,打开“管理工具”,打开“计算机管理”. 2.在左边栏中选择“存储”,再选择“磁盘管理”,在右边就会显示你计算机的磁盘分区

LVM 扩容报错:resize2fs: Bad magic number in super-block while......

废话不多说,这里直接举例说明: [[email protected] ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/vg_mysql0121366-LogVol02 7.7G 2.6G 4.8G 36% /tmpfs 495M 0 495M 0% /dev/shm/dev/sda1 194M 29M 155M 16% /boot/dev/mapper/vg_mysql0121366-LogVol01 8.0G 3.1

resize2fs: Bad magic number in super-block while t

resize2fs: Bad magic number in super-block while trying to open /dev/mapper/cl-root [[email protected] ~]# df -Th Filesystem          Type      Size  Used      Avail   Use%   Mounted on /dev/mapper/cl-root      xfs     18G     18G    897M    96%    /

resize2fs: Bad magic number in super-block while trying to open

I am trying to resize a logical volume on CentOS7 but am running into the following error: resize2fs 1.42.9 (28-Dec-2013) resize2fs: Bad magic number in super-block while trying to open /dev/mapper/centos-root Couldn't find valid filesystem superbloc

LINUX下为LVM磁盘增加硬盘空间

1,为客户机增加一块新的硬盘 2, 重启客户机 3, 用fdisk -l查看整个磁盘空间 #fdisk -l Disk /dev/sda: 34.4 GB, 34359738368 bytes 255 heads, 63 sectors/track, 4177 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O si

使用fdisk给新增加硬盘分区

1.使用fdisk创建6个分区[1P+1E(5L)]   //dev/sdb1 /dev/sdb5 /dev/sdb6 /dev/sdb7 /dev/sdb8 /deb/sdb9 1 [[email protected] ~]# fdisk -l 2 3 Disk /dev/sda: 8589 MB, 8589934592 bytes 4 255 heads, 63 sectors/track, 1044 cylinders 5 Units = cylinders of 16065 * 512

Ubuntu 16.04创建Swap分区或增加Swap分区容量

要在Ubuntu中要创建Swap分区主要有如下2种方式: 一.传统创建方式 一般情况下,我们都会使用dd命令来预先创建交换分区文件,然后再用/dev/zero将该文件的内容全部置零,创建时还将用到bs参数来设置要创建的交换空间大小,以及使用count来指定要创建的block数. 例如,我们要创建4G的交换分区文件可以使用如下命令: sudo dd if=/dev/zero of=/swapfile bs=1G count=4 二.快速创建方式 你可能已经注意到了,上述方式创建Swap交换文件的过

怎样让硬盘分区显示整数大小

怎样让硬盘分区显示整数大小 经常在使用电脑的会发现自己的 C ,D,E, F盘分的都不是整数,细心的感觉不是很好,那么如何在下次装机的时候让你的所有分区都是你想要的整数分区呢,下面我介绍一下我的两种方法. 工具/原料 计算器 ,或硬盘整数分区计算器 方法/步骤1 先为大家详细分析硬盘分区容量显示原理: 不论是机械硬盘还是固态SSD硬盘,厂商为了换算方便,是按照千进制来计算硬盘容量的,例如一块1TB(1000G)的硬盘实际容量是1,000,000,000,000Bit=976,562,500KB=

LVM做扩容Bad magic number in super-block while trying

环境:CentOS Linux release 7.2.1511 (Core)做LVM 逻辑卷扩容的时候报错: (扩容逻辑边界)shell>resize2fs -p /dev/mapper/centos-root resize2fs 1.42.9 (28-Dec-2013)resize2fs: Bad magic number in super-block while trying to open /dev/mapper/centos-rootCouldn't find valid filesy