LVM磁盘管理实录《江苏智简云网络安全小知识》

发布时间:2022-11-24 16:57

 

[root@kvm01 ~]# fdisk -l
Disk /dev/sda: 122.9 GB, 122941242880 bytes
255 heads, 63 sectors/track, 14946 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: 0x0001e60a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       14947   119545856   8e  Linux LVM

Disk /dev/mapper/vg_kvm03-lv_root: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 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/mapper/vg_kvm03-lv_swap: 6316 MB, 6316621824 bytes
255 heads, 63 sectors/track, 767 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/mapper/vg_kvm03-lv_home: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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

[root@kvm01 ~]# lvreduce -L -20G /dev/mapper/vg_kvm03-lv_home
  Unable to reduce lv_home below 1 extent
  Run `lvreduce --help' for more information.
[root@kvm01 ~]# lvreduce -L -10G /dev/mapper/vg_kvm03-lv_home
  WARNING: Reducing active logical volume to 10.00 GiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_home? [y/n]: y
  Reducing logical volume lv_home to 10.00 GiB
  Logical volume lv_home successfully resized

[root@kvm01 ~]# vgdisplay 
  --- Volume group ---
  VG Name               vg_kvm03
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  7
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               114.00 GiB
  PE Size               4.00 MiB
  Total PE              29185
  Alloc PE / Size       24546 / 95.88 GiB
  Free  PE / Size       4639 / 18.12 GiB
  VG UUID               VOXTxP-311D-4Ogf-VW3U-ngrL-mQjf-NzkyfH

[root@kvm01 ~]# lvextend -L +18G /dev/mapper/vg_kvm03-lv_root
  Extending logical volume lv_root to 98.00 GiB
  Logical volume lv_root successfully resized
[root@kvm01 ~]# vgdisplay 
  --- Volume group ---
  VG Name               vg_kvm03
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               114.00 GiB
  PE Size               4.00 MiB
  Total PE              29185
  Alloc PE / Size       29154 / 113.88 GiB
  Free  PE / Size       31 / 124.00 MiB
  VG UUID               VOXTxP-311D-4Ogf-VW3U-ngrL-mQjf-NzkyfH

[root@kvm01 ~]# e2fsck -f  /dev/mapper/vg_kvm03-lv_root
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/vg_kvm03-lv_root is mounted.
e2fsck: Cannot continue, aborting.

[root@kvm01 ~]# resize2fs /dev/mapper/vg_kvm03-lv_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vg_kvm03-lv_root is mounted on /; on-line resizing required
old desc_blocks = 5, new_desc_blocks = 7
Performing an on-line resize of /dev/mapper/vg_kvm03-lv_root to 25690112 (4k) blocks.
The filesystem on /dev/mapper/vg_kvm03-lv_root is now 25690112 blocks long.

[root@kvm01 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_kvm03-lv_root
                       97G   46G   46G  51% /
tmpfs                 5.9G     0  5.9G   0% /dev/shm
/dev/sda1             485M  148M  312M  33% /boot

公司主页:http://idc31.com/
公司全称:江苏智简云计算有限公司

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

### 江苏智简,江苏智简云,江苏智简云计算,idc31.com,www.idc31.com,徐州华为云,徐州服务器租用,徐州服务器托管,徐州数据中心,徐州云服务器,徐州网站建设,徐州APP搭建,徐州小程序开发,徐州APP开发,徐州网络安全,徐州网络维护,徐州网站维护,徐州网站搭建,徐州网络搭建,徐州网络攻击解决方案,徐州租用服务器,徐州托管服务器,徐州电信机房,徐州联通机房,徐州移动机房,徐州单线机房,徐州双线机房,徐州多线机房,徐州BGP线路机房,徐州系统安装,徐州VPS,徐州虚拟空间,徐州域名注册,徐州网站下载 ,徐州idc公司,徐州网络公司,徐州IDC公司排名,徐州网络公司排名,徐州互联网公司,徐州互联网公司排名,江苏华为云,江苏服务器租用,江苏服务器托管,江苏数据中心,江苏云服务器,江苏网站建设,江苏APP搭建,江苏小程序开发,江苏APP开发,江苏网络安全,江苏网络维护,江苏网站维护,江苏网站搭建,江苏网络搭建,江苏网络攻击解决方案,江苏租用服务器,江苏托管服务器,江苏电信机房,江苏联通机房,江苏移动机房,江苏单线机房,江苏双线机房,江苏多线机房,江苏BGP线路机房,江苏系统安装,江苏VPS,江苏虚拟空间,江苏域名注册,江苏网站下载 ,江苏idc公司,江苏网络公司,江苏IDC公司排名,江苏网络公司排名,江苏互联网公司,江苏互联网公司排名,企业服务器租用,游戏服务器租用,华为云服务器,阿里云服务器,腾讯云服务器,百度云服务器 虚拟云主机,网站备案,云虚拟主机,徐州电信,高防IP,免费永久服务器,云服务器网站,企业云服务器,网站云服务器### 

客户热线:0516-85619661

客户服务中心