Partioning 2
Partioning 2
[root@classs ~]#
Changes will remain in memory only, until you decide to write them.
Command action
a toggle a bootable flag
d delete a partition
Partition type:
e extended
Syncing disks.
[root@classs ~]#
[root@classs ~]#
Removing/decommissioning
disk:
1. Identify the device or mount point
2.
3. Unmount the partition/device
4. Remove the entry from /etc/fstab
5. Remove the partition from the disk.
[root@classs ~]#
[root@classs ~]#
[root@classs ~]# vi /etc/fstab - remove the /backup line by using dd and write and quit
[root@classs ~]#
Changes will remain in memory only, until you decide to write them.
Selected partition 1
Partition 1 is deleted
Syncing disks.
[root@classs ~]
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Partition type:
e extended
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
Syncing disks.
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
11 0 4420608 sr0
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
11 0 4420608 sr0
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
8 18 512000 sdb2
11 0 4420608 sr0
no label, UUID=34718292-ebda-46b6-a70a-a9ba34b27ec9
[root@classs ~]#
512+0 records in
512M /swap
/swap: data
no label, UUID=99ed52a9-e033-448e-baee-42e71b1eaaf7
[root@classs ~]#
[root@classs ~]#
======================== partitions======
Changes will remain in memory only, until you decide to write them.
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
Syncing disks.
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
8 18 512000 sdb2
11 0 4420608 sr0
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
8 18 512000 sdb2
11 0 4420608 sr0
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
11 0 4420608 sr0
[root@classs ~]#
.
LVM: Logical volume manager, we can extend the filesystem size in online without interrupting the
services and also it supports snapshot feature.
Changes will remain in memory only, until you decide to write them.
Partition type:
e extended
Partition type:
e extended
The kernel still uses the old table. The new table will be used at
Syncing disks.
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
11 0 4420608 sr0
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
11 0 4420608 sr0
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
8 18 307200 sdb2
8 19 102400 sdb3
11 0 4420608 sr0
WARNING: swap signature detected on /dev/sdb2 at offset 4086. Wipe it? [y/n]: y
PV Name /dev/sda2
VG Name rhel
Total PE 3583
Free PE 0
Allocated PE 3583
PV UUID 2keweW-8eIN-xqXq-bz0y-t9f8-Xn2Q-Kc9UjQ
PV Name /dev/sdb2
VG Name
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID WpZrFV-2t8W-FJT6-11tu-S9RT-8Bae-GQe8TB
PV Name /dev/sdb3
VG Name
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 0moIGd-psts-7ef1-KQVc-fY5q-9TRB-Drlmhq
VG Name vg0
System ID
Format lvm2
Metadata Areas 2
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 2
Act PV 2
Total PE 98
VG UUID wKowh2-wgPN-iaeJ-sSQU-KRNT-fd2T-oliU3J
[root@classs ~]#
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
Filesystem label=
OS type: Linux
Filesystem label=
OS type: Linux
13 block groups
VG Name vg0
System ID
Format lvm2
Metadata Areas 2
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 2
Act PV 2
Total PE 98
VG UUID wKowh2-wgPN-iaeJ-sSQU-KRNT-fd2T-oliU3J
Size of logical volume vg0/lv_sapdata2 changed from 100.00 MiB (25 extents) to 152.00 MiB (38
extents).
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root rhel -wi-ao---- <12.50g
old_desc_blocks = 1, new_desc_blocks = 2
[root@classs ~]#
Changes will remain in memory only, until you decide to write them.
Partition type:
e extended
Selected partition 4
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
Syncing disks.
2 0 4 fd0
8 0 15728640 sda
8 1 1048576 sda1
8 2 14679040 sda2
8 16 2097152 sdb
8 17 512000 sdb1
8 18 307200 sdb2
8 19 102400 sdb3
8 20 0 sdb4
8 21 409600 sdb5
11 0 4420608 sr0
[root@classs ~]#
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
[root@classs archive]# ls
vg0_00001-743391900.vg vg0_00004-1130380576.vg
total 32
TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
Restoring VG with active LVs, may cause mismatch with its metadata.
Do you really want to proceed with restore of volume group "vg0", while 2 volume(s) are active? [y/n]: y
Restoring VG with active LVs, may cause mismatch with its metadata.
Do you really want to proceed with restore of volume group "vg0", while 2 volume(s) are active? [y/n]: y
Scan of VG vg0 from /dev/sdb2 found mda_checksum f4f38aa6 mda_size 2084 vs previous 77e382bf
1779
Scan of VG vg0 from /dev/sdb3 found mda_checksum f4f38aa6 mda_size 2084 vs previous 77e382bf
1779
Scan of VG vg0 from /dev/sdb5 found mda_checksum f4f38aa6 mda_size 2084 vs previous 77e382bf
1779
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
[root@classs archive]#
1. Umount the lv
2. Run e2fsck –f <lvname>
3. Run resize2fs lvname <original size after reducing the lvm>
4. Mount the lv
LAB:
lsblk
partprobe or karpartx or partx -a--> to update the partions information into kernel
memory.
3. enable the swap singinature on created swap partition. mkswap <partion name>
swapon -s
# fdisk /dev/sdb
# partprobe
# mkfs.xfs /dev/vg00/lv00
# mkdir /test
# umount /test
# mkfs.xfs -f /dev/vg00/lv00
# ls -l /test
Removing LV.
1. Umount the lv # umount <lv> or lvmount point
2. Remove the # lvremove lvname
3. Remove entry from /etc/fstab
4. Remove the vg # vgremove <vgname>
5. Remove the pv # pvremove pvnames…
6. Delete the partitions from the disk. # fdisk </dev/sdx>
[root@classs ~]# df -hT
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
[root@classs ~]#