~~~~~ Warning !!! Content posted here are gained through the real world experience or some may come from training or any other Internet sources. Reading this blog may confuse you or may increase understanding of UNIX/Linux operating system and its component. It might help you to land on Real job or may fire your from the Real job. So, use on your own risk !!! No left or right reserved !!! -Kamal ~~~~~
Sunday, March 29, 2015
LVM_FS_Creation
[root@puppet tmp]# more my_LVM
# VG FS Size MPoint
test_vg FS_WWW 500 /www
test_vg FS_WWW2 500 /www2
test_vg FS_WWW3 500 /www3
test_vg FS_WWW4 500 /www4
[root@puppet tmp]# cat my_LVM.sh
#!/bin/sh
#
PATH=$PATH:/bin:/usr/bin; export PATH
echo "Please wait, filesystem creation task on progress ..."
sleep 5
cat my_LVM | grep -v "^#" | while read myvg myfs mysize mymnt
do
lvremove /dev/${myvg}/${myfs}
lvcreate -L ${mysize}M -n ${myfs} ${myvg} 2>/dev/null
mkfs.ext4 /dev/${myvg}/${myfs} 2>/dev/null
mkdir -p ${mymnt}
echo "/dev/${myvg}/${myfs} ${mymnt} ext4 defaults 1 2" >>/etc/fstab
done
mount -a; df -h
echo "Task completed. Please verify"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment