lvm扩展详细操作过程(已经成功操作)

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

[root@backupserver ~]# ls
anaconda-ks.cfg Desktop Documents Downloads install.log install.log.syslog Music Pictures Public Templates Videos
[root@backupserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 49G 2.5G 44G 6% /
tmpfs 2.0G 112K 2.0G 1% /dev/shm
/dev/sda1 194M 51M 134M 28% /boot
/dev/mapper/vg_backup-lv_backup
579G 429G 121G 79% /data/backup
[root@backupserver ~]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x21375428.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): 1
First cylinder (1-65270, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-65270, default 65270): 65270

Command (m for help): p

Disk /dev/sdd: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x21375428

Device Boot Start End Blocks Id System
/dev/sdd1 1 65270 524281243+ 83 Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L

0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
1 FAT12 39 Plan 9 82 Linux swap / So c1 DRDOS/sec (FAT-
2 XENIX root 3c PartitionMagic 83 Linux c4 DRDOS/sec (FAT-
3 XENIX usr 40 Venix 80286 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
4 FAT16 <32M 41 PPC PReP Boot 85 Linux extended c7 Syrinx
5 Extended 42 SFS 86 NTFS volume set da Non-FS data
6 FAT16 4d QNX4.x 87 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4e QNX4.x 2nd part 88 Linux plaintext de Dell Utility
8 AIX 4f QNX4.x 3rd part 8e Linux LVM df BootIt
9 AIX bootable 50 OnTrack DM 93 Amoeba e1 DOS access
a OS/2 Boot Manag 51 OnTrack DM6 Aux 94 Amoeba BBT e3 DOS R/O
b W95 FAT32 52 CP/M 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs
e W95 FAT16 (LBA) 54 OnTrackDM6 a5 FreeBSD ee GPT
f W95 Ext'd (LBA) 55

EZ-Drive a6
OpenBSD ef EFI (FAT-12/16/
10 OPUS 56 Golden Bow a7 NeXTSTEP f0 Linux/PA-RISC b
11 Hidden FAT12 5c Priam Edisk a8 Darwin UFS f1 SpeedStor
12 Compaq diagnost 61 SpeedStor a9 NetBSD f4 SpeedStor
14 Hidden FAT16 <3 63 GNU HURD or Sys ab Darwin boot f2 DOS secondary
16 Hidden FAT16 64 Novell Netware af HFS / HFS+ fb VMware VMFS
17 Hidden HPFS/NTF 65 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 70 DiskSecure Mult b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 75 PC/IX bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 80 Old Minix be Solaris boot ff BBT
1e Hidden W95 FAT1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sdd: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x21375428

Device Boot Start End Blocks Id System
/dev/sdd1 1 65270 524281243+ 8e Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@backupserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 49G 2.5G 44G 6% /
tmpfs 2.0G 112K 2.0G 1% /dev/shm
/dev/sda1 194M 51M 134M 28% /boot
/dev/mapper/vg_backup-lv_backup
579G 429G 121G 79% /data/backup
[root@backupserver ~]# fdisk -l

Disk /dev/sda: 146.8 GB, 146814976000 bytes
255 heads, 63 sectors/track, 17849 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: 0x0001425b

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 6400 51200000 83 Linux
/dev/sda3 6400 7165 6144000 82 Linux swap / Solaris

Disk /dev/sdb: 146.8 GB, 146814976000 bytes
255 heads, 63 sectors/track, 17849 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: 0x00000000

Device Boot Start End Blocks Id System

Disk /dev/sdc: 644.2 GB, 644245094400 bytes
255 heads, 63 sectors/track, 78325 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: 0xeec285de

Device Boot Start End Blocks Id System
/dev/sdc1 1 78325 629145531 8e Linux LVM

Disk /dev/sdd: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x21375428

Device Boot Start End Blocks Id System
/dev/sdd1 1 65270 524281243+ 8e Linux LVM

Disk /dev/dm-0: 630.8 GB, 630823321600 bytes
255 heads, 63 sectors/track, 76693 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: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table
[root@backupserver ~]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdc (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
[root@backupserver ~]# fdisk -l

Disk /dev/sda: 146.8 GB, 146814976000 bytes
255 heads, 63 sectors/track, 17849 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: 0x0001425b

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 6400 51200000 83 Linux
/dev/sda3 6400 7165 6144000 82 Linux swap / Solaris

Disk /dev/sdb: 146.8 GB, 146814976000 bytes
255 heads, 63 sectors/track, 17849 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: 0x00000000

Device Boot Start End Blocks Id System

Disk /dev/sdc: 644.2 GB, 644245094400 bytes
255 heads, 63 sectors/track, 78325 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: 0xeec285de

Device Boot Start End Blocks Id System
/dev/sdc1 1 78325 629145531 8e Linux LVM

Disk /dev/sdd: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x21375428

Device Boot Start
End Blocks Id System
/dev/sdd1 1 65270 524281243+ 8e Linux LVM

Disk /dev/dm-0: 630.8 GB, 630823321600 bytes
255 heads, 63 sectors/track, 76693 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: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table
[root@backupserver ~]# df -hy
df: invalid option -- 'y'
Try `df --help' for more information.
[root@backupserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 49G 2.5G 44G 6% /
tmpfs 2.0G 112K 2.0G 1% /dev/shm
/dev/sda1 194M 51M 134M 28% /boot
/dev/mapper/vg_backup-lv_backup
579G 429G 121G 79% /data/backup
[root@backupserver ~]# pvcreate /dev/sdd
Physical volume "/dev/sdd" successfully created
[root@backupserver ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sdc1
VG Name vg_backup
PV Size 600.00 GiB / not usable 127.93 MiB
Allocatable yes
PE Size 128.00 MiB
Total PE 4799
Free PE 99
Allocated PE 4700
PV UUID AiBjyD-iK1V-XGzv-xcH9-tKNe-F7Yx-1zFuPW

"/dev/sdd" is a new physical volume of "500.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdd
VG Name
PV Size 500.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID cfdsFr-kR9N-4J1t-M78z-cQw3-7wKF-N1iI50

[root@backupserver ~]# pvscan
PV /dev/sdc1 VG vg_backup lvm2 [599.88 GiB / 12.38 GiB free]
PV /dev/sdd lvm2 [500.00 GiB]
Total: 2 [1.07 TiB] / in use: 1 [599.88 GiB] / in no VG: 1 [500.00 GiB]
[root@backupserver ~]# vgextend vg_backup /dev/sdd
Volume group "vg_backup" successfully extended
[root@backupserver ~]# pvscan
PV /dev/sdc1 VG vg_backup lvm2 [599.88 GiB / 12.38 GiB free]
PV /dev/sdd VG vg_backup lvm2 [499.88 GiB / 499.88 GiB free]
Total: 2 [1.07 TiB] / in use: 2 [1.07 TiB] / in no VG: 0 [0 ]
[root@backupserver ~]# lvextend -L +499G /dev/vg_backup/lv_bakcup
Logical volume lv_bakcup not found in volume group vg_backup
[root@backupserver ~]# lvextend -L +499G /dev/vg_backup/lv_backup
Extending logical volume lv_backup to 1.06 TiB
Logical volume lv_backup successfully resized
[root@backupserver ~]# ls
anaconda-ks.cfg Desktop Documents Downloads install.log install.log.syslog Music Pictures Public Templates Videos
[root@backupserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 49G 2.5G 44

G 6% /
tmpfs 2.0G 112K 2.0G 1% /dev/shm
/dev/sda1 194M 51M 1
34M 28% /boot
/dev/mapper/vg_backup-lv_backup
579G 429G 121G 79% /data/backup
[root@backupserver ~]# resize2fs /dev/vg_bakcup/lv_backup
resize2fs 1.41.12 (17-May-2010)
open: No such file or directory while opening /dev/vg_bakcup/lv_backup
[root@backupserver ~]# resize2fs /dev/vg_backup/lv_backup
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/vg_backup/lv_backup is mounted on /data/backup; on-line resizing required
old desc_blocks = 37, new_desc_blocks = 68
Performing an on-line resize of /dev/vg_backup/lv_backup to 284819456 (4k) blocks.
The filesystem on /dev/vg_backup/lv_backup is now 284819456 blocks long.

[root@backupserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 49G 2.5G 44G 6% /
tmpfs 2.0G 112K 2.0G 1% /dev/shm
/dev/sda1 194M 51M 134M 28% /boot
/dev/mapper/vg_backup-lv_backup
1.1T 429G 587G 43% /data/backup
[root@backupserver 20111021]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 49G 2.5G 44G 6% /
tmpfs 2.0G 112K 2.0G 1% /dev/shm
/dev/sda1 194M 51M 134M 28% /boot
/dev/mapper/vg_backup-lv_backup
1.1T 429G 587G 43% /data/backup
[root@backupserver 20111021]# exit
logout


相关文档
最新文档