LVM XFS增加硬碟分割槽容量(resize2fs: Bad magic number in super-block while)
LVM XFS增加硬碟分割槽容量(resize2fs: Bad magic number in super-block while)
給某個硬碟增加分割槽之後
[root@Mysql01-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大小
[root@Mysql01-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
進行分割槽
[root@Mysql01-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
建立物理卷
[root@Mysql01-213-66 ~]# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created
使用vgscan查詢物理卷
[root@Mysql01-213-66 ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg_mysql0121366" using metadata type lvm2
使用新增物理卷擴充套件vg
[root@Mysql01-213-66 ~]# vgextend vg_mysql0121366 /dev/sda3
Volume group "vg_mysql0121366" successfully extended
[root@Mysql01-213-66 ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg_mysql0121366" using metadata type lvm2
查詢vg
[root@Mysql01-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
[root@Mysql01-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
[root@Mysql01-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
[root@Mysql01-213-66 ~]# lvextend -L +19G /dev/mapper/vg_mysql0121366-LogVol01
Extending logical volume LogVol01 to 27.00 GiB
Logical volume LogVol01 successfully resized
[root@Mysql01-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,這裡報錯了
[root@Mysql01-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.
[root@Mysql01-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
[root@Mysql01-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
給某個硬碟增加分割槽之後
[root@Mysql01-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大小
[root@Mysql01-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
進行分割槽
[root@Mysql01-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
建立物理卷
[root@Mysql01-213-66 ~]# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created
使用vgscan查詢物理卷
[root@Mysql01-213-66 ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg_mysql0121366" using metadata type lvm2
使用新增物理卷擴充套件vg
[root@Mysql01-213-66 ~]# vgextend vg_mysql0121366 /dev/sda3
Volume group "vg_mysql0121366" successfully extended
[root@Mysql01-213-66 ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg_mysql0121366" using metadata type lvm2
查詢vg
[root@Mysql01-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
[root@Mysql01-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
[root@Mysql01-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
[root@Mysql01-213-66 ~]# lvextend -L +19G /dev/mapper/vg_mysql0121366-LogVol01
Extending logical volume LogVol01 to 27.00 GiB
Logical volume LogVol01 successfully resized
[root@Mysql01-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,這裡報錯了
[root@Mysql01-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.
[root@Mysql01-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
[root@Mysql01-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
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24486203/viewspace-1790666/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Bad magic number for central directory
- Linux 新增LVM分割槽及LVM分割槽擴容LinuxLVM
- SSD固態硬碟要分割槽嗎?不同容量SSD固態硬碟分割槽方案建議硬碟
- win10新增硬碟分割槽怎麼操作 win10硬碟如何增加新分割槽Win10硬碟
- LVM分割槽恢復LVM
- linux硬碟分割槽Linux硬碟
- 非 LVM 分割槽動態擴容LVM
- SSD固態硬碟要分割槽嗎?SSD固態硬碟分割槽與不分割槽的效能對比硬碟
- linux之硬碟分割槽管理Linux硬碟
- DiskGenius分割槽行動硬碟硬碟
- ghost win10如何分割槽硬碟_ghost win10怎麼分割槽硬碟Win10硬碟
- Oracle分割槽表基礎運維-07增加分割槽(2 HASH分割槽)Oracle運維
- 如何在 Linux 中擴充套件 XFS 根分割槽Linux套件
- win10系統硬碟如何分割槽_win10主硬碟怎麼分割槽Win10硬碟
- 電腦硬碟分割槽要注意什麼,刪除硬碟分割槽的注意事項硬碟
- Oracle分割槽表基礎運維-07增加分割槽(1範圍分割槽)Oracle運維
- Linux中lvm分割槽是什麼?LVM優缺點有哪些?LinuxLVM
- 分割槽表之自動增加分割槽(11G)
- win10 c盤新增容量怎麼操作_win10系統如何增加c盤分割槽容量Win10
- win10擴充c盤容量怎麼設定 win10怎樣增加c盤分割槽容量Win10
- Oracle分割槽表基礎運維-07增加分割槽(3列表分割槽)Oracle運維
- win10硬碟分割槽怎麼分_win10系統如何對硬碟分割槽Win10硬碟
- 3tb硬碟怎麼分割槽_利用DiskGenius給3tb硬碟分割槽的方法硬碟
- windows11怎麼分割槽硬碟 win11硬碟分割槽大小方法介紹Windows硬碟
- 在 Linux 中建立 LVM 分割槽的分步指南LinuxLVM
- win10系統硬碟分割槽怎麼分 win10硬碟分割槽教程圖解Win10硬碟圖解
- Linux硬碟分割槽生效命令partprobeLinux硬碟
- 硬碟空間的管理和分割槽硬碟
- Liunx新增新硬碟和分割槽方法硬碟
- 9.2 Linux硬碟分割槽和掛載Linux硬碟
- mysql分割槽表佔用大量容量處理(最佳化)及歸檔分割槽表MySql
- SSD固態硬碟是分割槽好還是不分割槽好?SSD固態硬碟使用注意事項硬碟
- win10硬碟分割槽工具哪個好_win10電腦什麼硬碟分割槽工具最好Win10硬碟
- win10硬碟分割槽丟失怎麼辦_win10硬碟分割槽不顯示如何找回Win10硬碟
- Oracle分割槽表基礎運維-07增加分割槽(4 RANGE_HASH)Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(5RANGE_LIST)Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(6RANGE_RANGE)Oracle運維
- 增加表分割槽時,為local分割槽索引指定不同表空間的方法索引
- 電腦硬碟分割槽表損壞怎麼修復?電腦硬碟分割槽表損壞的修復方法硬碟