Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1004043
  • 博文数量: 195
  • 博客积分: 4890
  • 博客等级: 上校
  • 技术积分: 2221
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-09 15:34
文章分类

全部博文(195)

文章存档

2014年(1)

2013年(8)

2012年(22)

2011年(9)

2010年(54)

2009年(101)

我的朋友

分类: LINUX

2010-08-12 12:04:31

一、硬件环境
   a) CPU:
      AMD Athlon 64 X2 Dual Core Processor 4400+
   b) 硬盘
      硬盘:单硬盘:80G SATA
     Disk /dev/sda: 80.0 GB, 80026361856 bytes
     255 heads, 63 sectors/track, 9729 cylinders
二、操作系统
       Linux版本: Red Hat Enterprise Linux AS release 5 x86_64
        Kernel版本: 2.6.18-8.el5 #1 SMP x86_64
三、已有LVM
/dev/mapper/ggyyvg-ggyylv    2.8G   69M 2.6G   3% /mnt/lvm1
            LV Name                /dev/ggyyvg/ggyylv
四、删除LVM
            A)umount挂载点
                        [root@localhost mnt]# umount lvm1
            B)删除LV
 [root@localhost mnt]# lvdisplay
 --- Logical volume ---
 LV Name                /dev/ggyyvg/ggyylv
 VG Name                ggyyvg
 LV UUID                aU0ncf-e66C-Urkw-d4oh-KNy8-gCAf-f80PcH
 LV Write Access        read/write
 LV Status              available
 # open                 0
 LV Size                2.81 GB
 Current LE             720
 Segments               3
 Allocation             inherit
 Read ahead sectors     0
 Block device           253:0
                        [root@localhost mnt]# lvremove /dev/ggyyvg/ggyylv
Do you really want to remove active logical volume "ggyylv"? [y/n]: y
 Logical volume "ggyylv" successfully removed
            C)删除VG
 [root@localhost mnt]# vgdisplay
 --- Volume group ---
 VG Name               ggyyvg
 System ID            
 Format                lvm2
 Metadata Areas        3
 Metadata Sequence No 5
 VG Access             read/write
 VG Status             resizable
 MAX LV                0
 Cur LV                0
 Open LV               0
 Max PV                0
 Cur PV                3
 Act PV                3
 VG Size               2.81 GB
 PE Size               4.00 MB
 Total PE              720
 Alloc PE / Size       0 / 0  
 Free PE / Size       720 / 2.81 GB
 VG UUID               eglfo6-8vf1-IewM-ZQnp-P2mm-I6cs-oR13ns
  
[root@localhost mnt]# vgremove ggyyvg
 Volume group "ggyyvg" successfully removed
            D)删除PV
[root@localhost mnt]# pvdisplay
 --- NEW Physical volume ---
 PV Name               /dev/sda9
 VG Name              
 PV Size               486.31 MB
 Allocatable           NO
 PE Size (KByte)       0
 Total PE              0
 Free PE               0
 Allocated PE          0
 PV UUID               jW9lXC-o5iO-Xxvd-44if-Ydrh-xMJd-md2H0C
  
 --- NEW Physical volume ---
 PV Name               /dev/sda10
 VG Name              
 PV Size               964.81 MB
 Allocatable           NO
 PE Size (KByte)       0
 Total PE              0
 Free PE               0
 Allocated PE          0
 PV UUID               H2FgzL-pFlE-cNU1-mI38-ysOA-yooZ-Op6UoS
  
 --- NEW Physical volume ---
 PV Name               /dev/sda11
 VG Name              
 PV Size               1.40 GB
 Allocatable           NO
 PE Size (KByte)       0
 Total PE              0
 Free PE               0
 Allocated PE          0
 PV UUID               d7sumA-ty4j-XaS6-4AEE-Fgo4-ZtGX-LrC3Gr
  
[root@localhost mnt]# pvremove /dev/sda9
 Labels on physical volume "/dev/sda9" successfully wiped
[root@localhost mnt]# pvremove /dev/sda10
 Labels on physical volume "/dev/sda10" successfully wiped
[root@localhost mnt]# pvremove /dev/sda11
 Labels on physical volume "/dev/sda11" successfully wiped
[root@localhost mnt]# pvdisplay
            E)删除物理分区
 [root@localhost mnt]# fdisk /dev/sda
 
The number of cylinders for this disk is set to 9729.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
 
Command (m for help): p
 
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id System
/dev/sda1   *           1          25      200781   83 Linux
/dev/sda2              26        2575    20482875   83 Linux
/dev/sda3            2576        3850    10241437+ 83 Linux
/dev/sda4            3851        9729    47223067+   5 Extended
/dev/sda5            3851       5125    10241406   83 Linux
/dev/sda6            5126        6400    10241406   83 Linux
/dev/sda7            6401        7037     5116671   83 Linux
/dev/sda8            7038        7050      104391   83 Linux
/dev/sda9            7051        7112      497983+ 83 Linux
/dev/sda10           7113        7235      987966   83 Linux
/dev/sda11           7236        7418     1469916   83 Linux
Command (m for help): d
Partition number (1-11): 11
 
Command (m for help): d
Partition number (1-10): 10
 
Command (m for help): d
Partition number (1-9): 9
 
Command (m for help): p
 
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id System
/dev/sda1   *           1          25      200781   83 Linux
/dev/sda2              26        2575    20482875   83 Linux
/dev/sda3            2576        3850    10241437+ 83 Linux
/dev/sda4            3851        9729    47223067+   5 Extended
/dev/sda5            3851        5125    10241406   83 Linux
/dev/sda6            5126        6400    10241406   83 Linux
/dev/sda7            6401        7037     5116671   83 Linux
/dev/sda8            7038        7050      104391   83 Linux
 
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.
Syncing disks.
            F)删除/dev/ggyyvg
                        Rm –rf /dev/ggyyvg
 
总结,删除是安装的逆过程,应该好理解
阅读(777) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-03-20 15:11:13

学习了,多谢楼主分享哦!也欢迎广大linux爱好者来我的论坛一起讨论arm哦!www.lt-net.cn