VMware Linux 创建/增加/减小 文件系统
来源:互联网 发布:上手机淘宝怎么买东西 编辑:程序博客网 时间:2024/06/06 02:15
Vmware create new file system:
1: Get approval for the extra disk resource from the virtual team.
2: Once aprove, grow the size of the existing disk in Vmware:
Edit Settings
selkect hard Disk
Increase "Provision Size"
Click "OK"
3: Run the following command to tell the kernel to re-scan the block devices and look for changes:
PV=sdb
echo 1 > /sys/block/${PV}/device/rescan
4: Now tell LVM to check the physical volumes and re-size them if neccesary:
pvresize /dev/$PV
5: Now create new logical volume:
lvcreate -n lv_data -l 100%FREE datavg
6: create a filesystem in it:
mkfs.ext4 /dev/datavg/lv_data
7: add the file system in /etc/fstab:
echo "echo/dev/datavg/lv_data /data ext4 defaults,nodev,nosuid 1 2" >> /etc/fstab
8: Mount it:
umask 022
mkdir /data
mount /data
--------------------------
Grow File system:
1: Find the name of the physical volume, in in this case its "dev/sdb"
vgdisplay -v appvg | grep "PV Name"
The result of : PV Name /dev/sdb
Notice: if you see /dev/sdb1, or /dev/sdb2, them this process will not work and you will need to re-partition the disk
and reboot the server.
2: In the VirtualCenter, increase the size of the disk that corresponds to /dev/sdb
Edit Setting
Select Harddisk
Increase "Provisioned Size"
Click OK
3: run command to rescan:
PV=sdb
echo 1 > /sys/block/${PV}/device/rescan
the result is the Operating system sees the new size
4:Now tell LVM to check the physical volumes and re-size them if necessary:
pvresize /dev/$PV
5: Now LVM can see the new size of the physical volume
Notice: If the disk has partitions, then you need to repartition the disk as well so the "slice" has the extra disk allocated before the
pvresize will work.
Now you need see free space in the physical volune and its volume group.
pvs
vgs appvg
6: Grow the file system:
lvextend -L +10G /dev/appvg/lv_apps
7: then use "resize2fs" to increase filesystem:
resize2fs <logical volume name>
---------------
Shrink File system:
1: Vmware:
This action can only be done OFFLINE
Unmount the file system:
df <filesystem mount point>
umount <filesystem mount point>
2: Check filesystem:
fsck -n <logical volume name>
3: Use the resize2fs and lvreduce commands to decrease the filesystem:
resize2fs <logical volume name> 50G
lvresuce -L 50G /dev/appvg/lv_apps
Attecntion: 50G is the new total size
4: Remount file system:
mount <filesystem mount point>
1: Get approval for the extra disk resource from the virtual team.
2: Once aprove, grow the size of the existing disk in Vmware:
Edit Settings
selkect hard Disk
Increase "Provision Size"
Click "OK"
3: Run the following command to tell the kernel to re-scan the block devices and look for changes:
PV=sdb
echo 1 > /sys/block/${PV}/device/rescan
4: Now tell LVM to check the physical volumes and re-size them if neccesary:
pvresize /dev/$PV
5: Now create new logical volume:
lvcreate -n lv_data -l 100%FREE datavg
6: create a filesystem in it:
mkfs.ext4 /dev/datavg/lv_data
7: add the file system in /etc/fstab:
echo "echo/dev/datavg/lv_data /data ext4 defaults,nodev,nosuid 1 2" >> /etc/fstab
8: Mount it:
umask 022
mkdir /data
mount /data
--------------------------
Grow File system:
1: Find the name of the physical volume, in in this case its "dev/sdb"
vgdisplay -v appvg | grep "PV Name"
The result of : PV Name /dev/sdb
Notice: if you see /dev/sdb1, or /dev/sdb2, them this process will not work and you will need to re-partition the disk
and reboot the server.
2: In the VirtualCenter, increase the size of the disk that corresponds to /dev/sdb
Edit Setting
Select Harddisk
Increase "Provisioned Size"
Click OK
3: run command to rescan:
PV=sdb
echo 1 > /sys/block/${PV}/device/rescan
the result is the Operating system sees the new size
4:Now tell LVM to check the physical volumes and re-size them if necessary:
pvresize /dev/$PV
5: Now LVM can see the new size of the physical volume
Notice: If the disk has partitions, then you need to repartition the disk as well so the "slice" has the extra disk allocated before the
pvresize will work.
Now you need see free space in the physical volune and its volume group.
pvs
vgs appvg
6: Grow the file system:
lvextend -L +10G /dev/appvg/lv_apps
7: then use "resize2fs" to increase filesystem:
resize2fs <logical volume name>
---------------
Shrink File system:
1: Vmware:
This action can only be done OFFLINE
Unmount the file system:
df <filesystem mount point>
umount <filesystem mount point>
2: Check filesystem:
fsck -n <logical volume name>
3: Use the resize2fs and lvreduce commands to decrease the filesystem:
resize2fs <logical volume name> 50G
lvresuce -L 50G /dev/appvg/lv_apps
Attecntion: 50G is the new total size
4: Remount file system:
mount <filesystem mount point>
0 0
- VMware Linux 创建/增加/减小 文件系统
- 在VMWare中增加Linux文件系统空间
- 在VMWare中增加Linux文件系统空间
- VMware+Linux增加硬盘
- vmware增加linux硬盘空间
- VMware增加Linux磁盘空间
- VMware增加Linux磁盘空间
- 在linux下如何把一个lvm的文件系统减小
- VMWare linux下增加磁盘空间
- 虚拟机 vmware 增加磁盘 (linux)
- VMware安装Linux,出现错误-未找到要在其中创建新文件系统
- 创建LINUX文件系统
- linux创建文件系统方法
- Linux 文件系统的创建
- Linux下创建文件系统
- VMware创建Linux虚拟机
- VMware 创建Linux虚拟机
- Vmware创建Linux虚拟机
- [Objective-C] iOS 开发中建议使用自动引用计数(ARC)
- 3.5多数据系列的柱状图
- Android-布局管理 (五大布局控件使用)
- nginx和lua
- iOS 对相机及相册的操作
- VMware Linux 创建/增加/减小 文件系统
- Redis Sentinel集群方案--单机测试
- 使用keepalived实现双机热备
- 内存泄漏分析及常用内存泄漏检测工具分享
- 学习设计模式的资源,持续添加
- python __init__.py
- C++多重继承
- 内存泄漏与内存溢出的区别
- Android DownloadManager的使用