1. Find out files owned by jack, and copy them to directory /root/findresults
find / -user jack -exec cp {} /root/findresults \;
2. Find out all the columns that contains the string seismic within /usr/share/dict/words, then copy all these columns to /root/lines.tx in original order, there is no blank line, all columns must be the accurate copy of the original columns.
cat /usr/share/dict/words | grep seismic > /root/lines.tx
3. Create a backup file named /root/backup.tar.bz2, contains the content of /usr/local, tar must use bzip2 to compress.
tar -cjvf /root/backup.tar.bz2 /usr/local
4. Create a logical volume -
Create a new logical volume as required:
Name the logical volume as database, belongs to datastore of the volume group, size is 50 PE.
Expansion size of each volume in volume group datastore is 16MB.
Use ext3 to format this new logical volume, this logical volume should automatically mount to /mnt/database
pvcreate /dev/sdb1 /dev/sdb2
vgcreate -s 16M datastore /dev/sdb1 /dev/sdb2
lvcreate -l 50 -n database datastore
mkfs.ext3 /dev/datastore/database
vi /etc/fstab
/dev/datastore/database /mnt/database ext3 defaults 0 0
mkdir /mnt/database
mount -a
5. Make a swap partition having 100MB. Make Automatically Usable at System Boot Time.
fdisk /dev/sdb 100m로 나눈다
vi /etc/fstab
/dev/sdb1 swap swap defaults 0 0
mkswap /dev/sdb1
swapon -a
6. One Logical Volume is created named as myvol under vo volume group and is mounted. The Initial Size of that Logical Volume is 400MB. Make successfully that the size of Logical Volume 200MB without losing any data. The size of logical volume 200MB to 210MB will be acceptable.
lvreduce /dev/vo/myvol -r -L 200M
손실없이 하려면 이 명령어를 쓴다.
7. We are working on /data initially the size is 2GB. The /dev/test0/lvtestvolume is mount on /data. Now you required more space on /data but you already added all disks belong to physical volume. You saw that you have unallocated space around 5 GB on your harddisk. Increase the size of lvtestvolume by 5GB.
lvextend -r -L +5G /dev/test0/lvtestvolume
이렇게 하면되지만 만약 vg의 용량이 부족하다면
vgextend test0 /dev/sdb3 으로 늘려준 다음 해주면 된다.
8. Make on data that only the user owner and group owner member can fully access.
(먼저 data가 어디 있는지 찾는다)
find / -name "data"
chmod 770 /data
9. Who ever creates the files/directories on a data group owner should automatically be in the same group owner as data.
chmod g+s /data
10. Please open the ip_forward, and take effect permanently.
(답 외울것)
명령실행 sysctl -w net.ipv4.ip_forward = 1
확인 cat /proc/sys/net/ipv4/ip_forward
만약 리부팅해도 적용이 안된다면 ?
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1 추가 해주고
sysctl -p /etc/sysctl.conf 실행