Friday, 20 June 2014

Remove LVM Partitions in Linux


vi /etc/fstab
remove the present lvm entry.

lvremove /dev/VGdata/LVdata
Do you really want to remove active logical volume LVdata? [y/n]: y
  Logical volume "LVdata" successfully removed

vgremove VGdata
  Volume group "VGdata" successfully removed

pvremove /dev/sdb1
  Labels on physical volume "/dev/sdb1" successfully wiped

fdisk /dev/sdb

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): p

Disk /dev/sdb: 26.8 GB, 26843545600 bytes
64 heads, 32 sectors/track, 25600 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b6891

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       25600    26214384   8e  Linux LVM

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 26.8 GB, 26843545600 bytes
64 heads, 32 sectors/track, 25600 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b6891

   Device Boot      Start         End      Blocks   Id  System

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

Calling ioctl() to re-read partition table.
Syncing disks.
You have new mail in /var/spool/mail/root

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.

reboot

Broadcast message from arao9aj@mb1utarmiweb01.pearsontc.com
        (/dev/pts/0) at 16:12 ...

The system is going down for reboot NOW!

Ref: http://www.linuxspy.com/1810/how-to-remove-lvm-partitions/

No comments:

Post a comment