Powered By Blogger

Tuesday, February 28, 2012

Working on extents on Redhat LVM

If you want to create Logical volume using extents:

By default PE size for volume group is 4 MB.


PE Size 4.00 MiB

If you want to change it, you can use -s option when you are creating volume group

For example

# vgcreate -s 8 helloguruvg /dev/sdh

For now, i am using default value which is 4 MB.

I am creating Logical volume with 30 extents (which will be 30 x 4 MB size)

[root@kumar ~]# lvcreate -l 30 -n hellogurulg helloguruvg

Making ext4 filesystem:

[root@kumar ~]# mkfs.ext4 /dev/mapper/helloguruvg-hellogurulg

[root@kumar ~]# mkdir /hellogurufs

[root@kumar ~]# mount /dev/mapper/helloguruvg-hellogurulg /hellogurufs

[root@kumar ~]# df -h

/dev/mapper/helloguruvg-hellogurulg 117M 5.6M 105M 6% /hellogurufs

Edit the fstab to make it persistent

Adding SWAP on Redhat using LVM

Following steps to add swap using LVM with out creating new partition

1) Check if you have enough space in the volume group

[root@kumar ~]# vgs
VG #PV #LV #SN Attr VSize VFree
test1VG 1 4 0 wz--n- 1020.00m 36.00m
testingextentvg 1 1 0 wz--n- 104.00m 24.00m
vgexttest 1 1 0 wz--n- 96.00m 32.00m


Following command will create Logical volume swaphello with the size 10 MB

[root@kumar ~]# lvcreate -L 10M -n swaphello test1VG

[root@kumar ~]# mkswap /dev/mapper/test1VG-swaphello

[root@kumar ~]# swapon /dev/mapper/test1VG-swaphello

Add swap entry in the fstab so that it will be persistent

[root@kumar ~]# vi /etc/fstab
/dev/mapper/test1VG-swaphello swap swap defaults 0 0

Check your work

[root@kumar ~]# free -m
[root@kumar ~]# swapon -s

Wednesday, February 15, 2012

chown on solaris 10 (Not owner error)

By default only root can change ownership on Solaris 10 (Even owner of the file can't change it)

If you want owner of the file/directory to update the owner:

Update the /etc/system with the following and reboot
rstchown=0

or

Following if you want to change (Enter commands in the RED) with out reboot (It is not persistent)



# adb -w -k /dev/ksyms /dev/mem
physmem 3ee50a8
rstchown/D
rstchown:rstchown: 1
rstchown?W0x0
rstchown: 0x1 = 0x0
rstchown/D
rstchown:rstchown: 0
Welcome to the UNIX world