您的当前位置:首页正文

lvm实验

2021-01-16 来源:汇智旅游网
删除lv

[root@catdb /]# lvremove oradata/backup

Do you really want to remove active logical volume \"backup\"? [y/n]: y Logical volume \"backup\" successfully removed [root@catdb /]# lvremove oradata/oradata

Do you really want to remove active logical volume \"oradata\"? [y/n]: y Logical volume \"oradata\" successfully removed

删除vg

vgremove oradata

删除pv

pvremove /dev/cciss/c0d1

创建pv

[root@catdb ~]# pvcreate /dev/cciss/c0d1

Physical volume \"/dev/cciss/c0d1\" successfully created

[root@catdb ~]# vgcreate ora_dg /dev/cciss/c0d1 Volume group \" ora_dg \" successfully created

- [root@catdb /]# vgdisplay -v ora_dg Using volume group(s) on command line Finding volume group \"ora_dg\" --- Volume group ---

VG Name ora_dg System ID Format lvm2 Metadata Areas 1

Metadata Sequence No 1

VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 279.36 GB PE Size 4.00 MB Total PE 71517

Alloc PE / Size 0 / 0

Free PE / Size 71517 / 279.36 GB

VG UUID 4NdkyW-CkJ6-0x41-NZyn-1e2y-2EGX-VWrYZH

--- Physical volumes ---

PV Name /dev/cciss/c0d1

PV UUID TXihPe-Sndx-hgnX-I8u3-RZql-svwN-j606hP PV Status allocatable Total PE / Free PE 71517 / 71517

lvcreate -L 180G -n oradata ora_dg lvcreate -L 98G -n backup ora_dg mkfs.ext3 /dev/ora_dg/oradata mkfs.ext3 /dev/ora_dg/backup

vi /etc/fstab

/dev/VolGroup00/LogVol01 / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 /dev/ora_dg/oradata /u02 ext3 defaults 0 0 /dev/ora_dg/backup /backup ext3 defaults 0 0 /dev/VolGroup00/LogVol00 swap swap defaults 0 0

/dev/scd0 /media/cdrom pamconsole,exec,noauto,managed 0 0

扩充root_dg

lvresize -L 110G /dev/VolGroup00/LogVol01

扩充swap

swap 分割区不用工具 resize2fs 這種 fs resize..

你的 swap 放 lvm 的话,要把 swap 空间变大的话,步骤大約是:

1. swapoff /dev/VolGroup00/LogVol01 2. lvextend -L size /dev/VolGroup00/LogVol01 3. mkswap /dev/VolGroup00/LogVol01 4. swapon /dev/VolGroup00/LogVol01

auto

因篇幅问题不能全部显示,请点此查看更多更全内容