1, find the file belong to lucy and copy to a folder,
create the find folder,
mkdir /tmp/findfilesfind the file the owner is lucy, use the parameter -user and -exec
find / -user lucy -exec cp -a {} /tmp/findfiles \;2, enlarge the lvm, no need to umount,
lvextend -L 190M /dev/mapper/vgsrv-commonthen extend the file system,
resize2fs /dev/mapper/vgsrv-common
you can also use the UI to edit the logic volume size,
yum install system-config-lvm
system-config-lvmIn the logic volume size, click the 'edit properties', and drag the size bar to modify the size.3, shrink another lvm, needs to umount first.
umount /shrinkneeds to check the file system,
e2fsck –f /dev/mapper/vgsrv-shrinkshrink the file system first,
resize2fs /dev/mapper/vgsrv-shrink 200Mshrink the lvm
lvreduce -L 200M /dev/mapper/vgsrv-shrinkmount again,
mount -a4, make swap partition and make it usable after booting,
create the swap partition and make the label as 0x82
fdisk /dev/sda
n to create the partition, size as +512M, t to change the label to 0x82, Partprobe not working, needs to reboot to make the swap partition be seen by mkswap command, or use the following command to make it usable,
partx -a /dev/sdaactivate swap,
mkswap /dev/sda3start to use the swap,
swapon /dev/sda3display the swap partition,
swapon -swrite into the /etc/fstab to make the swap partition bootable.
vim /etc/fstab
/dev/sda3 swap swap defaults 0 0
another way to create swap partition is to create file as following,
dd if=/dev/zero of=file bs=1M count=756 #to generate a file size as 756M
mkswap file
swapon file
vim /etc/fstab #modify the fstab file to auto mount
/root/file swap swap defaults 0 0to check the result, using following commands,
cat /proc/swaps
free -l
swapon -sswap partition create can refer to this link:
http://computernetworkingnotes.com/file-system-administration/how-to-create-swap-partition.html

本文详细介绍如何在Linux环境下进行文件查找与复制、调整逻辑卷大小、创建交换分区等操作。主要内容包括:通过find命令定位属于特定用户的文件并复制到指定文件夹;扩大或缩小逻辑卷(LVM)而不需卸载;创建并激活交换分区,确保系统启动时可用。
513

被折叠的 条评论
为什么被折叠?



