RHEL6 File system shrink
#take back-up
umount /opt
e2fsck -f /dev/mapper/VolGroup00-optvol
resize2fs /dev/mapper/VolGroup00-optvol 150G
lvchange -an /dev/mapper/VolGroup00-optvol
lvreduce -L 150G /dev/mapper/VolGroup00-optvol
lvchange -ay /dev/mapper/VolGroup00-optvol
e2fsck -f /dev/mapper/VolGroup00-optvol
RHEL6 File system extent on-line root fs
lvextend VolGroup00/rootvol -L +230G
resize2fs /dev/mapper/VolGroup00-rootvol 271G
Thursday, March 3, 2016
Wednesday, January 21, 2015
A complete list of FORMAT control characters supported by the date command
A complete list of FORMAT control characters supported by the date command
FORMAT controls the output. It can be the combination of any one of the following:
| %FORMAT String | Description |
|---|---|
| %% | a literal % |
| %a | locale's abbreviated weekday name (e.g., Sun) |
| %A | locale's full weekday name (e.g., Sunday) |
| %b | locale's abbreviated month name (e.g., Jan) |
| %B | locale's full month name (e.g., January) |
| %c | locale's date and time (e.g., Thu Mar 3 23:05:25 2005) |
| %C | century; like %Y, except omit last two digits (e.g., 21) |
| %d | day of month (e.g, 01) |
| %D | date; same as %m/%d/%y |
| %e | day of month, space padded; same as %_d |
| %F | full date; same as %Y-%m-%d |
| %g | last two digits of year of ISO week number (see %G) |
| %G | year of ISO week number (see %V); normally useful only with %V |
| %h | same as %b |
| %H | hour (00..23) |
| %I | hour (01..12) |
| %j | day of year (001..366) |
| %k | hour ( 0..23) |
| %l | hour ( 1..12) |
| %m | month (01..12) |
| %M | minute (00..59) |
| %n | a newline |
| %N | nanoseconds (000000000..999999999) |
| %p | locale's equivalent of either AM or PM; blank if not known |
| %P | like %p, but lower case |
| %r | locale's 12-hour clock time (e.g., 11:11:04 PM) |
| %R | 24-hour hour and minute; same as %H:%M |
| %s | seconds since 1970-01-01 00:00:00 UTC |
| %S | second (00..60) |
| %t | a tab |
| %T | time; same as %H:%M:%S |
| %u | day of week (1..7); 1 is Monday |
| %U | week number of year, with Sunday as first day of week (00..53) |
| %V | ISO week number, with Monday as first day of week (01..53) |
| %w | day of week (0..6); 0 is Sunday |
| %W | week number of year, with Monday as first day of week (00..53) |
| %x | locale's date representation (e.g., 12/31/99) |
| %X | locale's time representation (e.g., 23:13:48) |
| %y | last two digits of year (00..99) |
| %Y | year |
| %z | +hhmm numeric timezone (e.g., -0400) |
| %:z | +hh:mm numeric timezone (e.g., -04:00) |
| %::z | +hh:mm:ss numeric time zone (e.g., -04:00:00) |
| %:::z | numeric time zone with : to necessary precision (e.g., -04, +05:30) |
| %Z | alphabetic time zone abbreviation (e.g., EDT) |
Friday, October 24, 2014
VCS Commands
VCS Commands
haconf -makerw
hagrp -add app_sg
hagrp -modify app_sg SystemList node01 0 node02 1
hagrp -modify app_sg AutoStartList node01 node02
hagrp -display app_sg -attribute AutoStartList
hares -add app_dg DiskGroup app_sg
hares -add app_nic NIC app_sg
hares -add app_mnt Mount app_sg
hares -add app_vol Volume app_sg
hares -add app_ip IP app_sg
hares -list
hagrp -modify app_sg SystemList node01 node02
hagrp -modify app_sg SystemList node01 0 node02 1
hagrp -modify app_sg AutoStartList node02 node01
hagrp -modify app_sg SystemList node01 0 node02 1
hagrp -modify app_sg AutoStartList node01 node02
hares -modify app_dg DiskGroup webdg
hares -modify app_mnt BlockDevice /dev/vx/dsk/webdg/vol2
hares -modify app_mnt FSType vxfs
hares -modify app_mnt FsckOpt "-%y"
hares -modify app_mnt FsckOpt "%-y"
hares -modify app_mnt MountPoint /webvol2
hares -modify app_ip Device e1000g3
hares -modify app_ip Address 10.200.50.215
hares -modify app_ip NetMask 255.255.255.0
hares -modify app_vol Volume vol2
haconf -makerw
hagrp -add app_sg
hagrp -modify app_sg SystemList node01 0 node02 1
hagrp -modify app_sg AutoStartList node01 node02
hagrp -display app_sg -attribute AutoStartList
hares -add app_dg DiskGroup app_sg
hares -add app_nic NIC app_sg
hares -add app_mnt Mount app_sg
hares -add app_vol Volume app_sg
hares -add app_ip IP app_sg
hares -list
hagrp -modify app_sg SystemList node01 node02
hagrp -modify app_sg SystemList node01 0 node02 1
hagrp -modify app_sg AutoStartList node02 node01
hagrp -modify app_sg SystemList node01 0 node02 1
hagrp -modify app_sg AutoStartList node01 node02
hares -modify app_dg DiskGroup webdg
hares -modify app_mnt BlockDevice /dev/vx/dsk/webdg/vol2
hares -modify app_mnt FSType vxfs
hares -modify app_mnt FsckOpt "-%y"
hares -modify app_mnt FsckOpt "%-y"
hares -modify app_mnt MountPoint /webvol2
hares -modify app_ip Device e1000g3
hares -modify app_ip Address 10.200.50.215
hares -modify app_ip NetMask 255.255.255.0
hares -modify app_vol Volume vol2
hares -modify app_vol DiskGroup webdg
--
hares -link app_ip app_nic
hares -link app_mnt app_vol
hares -link app_mnt app_ip
hares -link app_vol app_dg
-------------
hares -modify app_mnt Critical 1
hares -modify app_dg Enabled 1
-----------------------
hares -list
hares -dep
---------
root@node01:/var/VRTSvcs/log # hastatus -sum
-- SYSTEM STATE
-- System State Frozen
A node01 RUNNING 0
A node02 RUNNING 0
-- GROUP STATE
-- Group System Probed AutoDisabled State
B apache_sg node01 Y N ONLINE
B apache_sg node02 Y N OFFLINE
B app_sg node01 Y N OFFLINE
B app_sg node02 Y N ONLINE
root@node01:/var/VRTSvcs/log #
----------------------------------------------------------------
hagrp -switch app_sg -to node02
Wednesday, September 10, 2014
Openfiler & ISCSI in Solaris 10
Some of the commands in Solaris 10 ISCSI
$ iscsiadm modify discovery --static enable
$ iscsiadm list static-config
$ iscsiadm add static-config iqn.2006-01.com.openfiler:tsn.2d3b68e3a76c,10.208.133.201:3260
$ iscsiadm remove static-config iqn.2006-01.com.openfiler:tsn.2d3b68e3a76c,10.208.133.201,3260
$ svcs -a |grep iscsi
online 23:34:48 svc:/network/iscsi/initiator:default
online 23:34:55 svc:/system/iscsitgt:default
$
Openfiler
1. Map ISCSI LUN
2. Share Network range.
(Incomplete doc)
Friday, October 5, 2012
Solaris 10 x86 SVM failed root disk replacement
Check the disk for errors with iostat -en, format etc.
+$ metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c3t3d0s7
a p luo 8208 8192 /dev/dsk/c3t3d0s7
a p luo 16400 8192 /dev/dsk/c3t3d0s7
W p luo 16 8192 /dev/dsk/c3t2d0s7
W p luo 8208 8192 /dev/dsk/c3t2d0s7
W p luo 16400 8192 /dev/dsk/c3t2d0s7
[02:57:16]
If you are seeing your metadb with 'W', then it has write errors.
$metastat -c
d60 m 120GB d61 d62 (maint)
d61 s 120GB c3t3d0s6
d62 s 120GB c3t2d0s6 (maint)
d40 m 2.0GB d41 d42 (maint)
d41 s 2.0GB c3t3d0s4
d42 s 2.0GB c3t2d0s4 (maint)
d30 m 4.0GB d31 d32 (maint)
d31 s 4.0GB c3t3d0s3
d32 s 4.0GB c3t2d0s3 (maint)
d10 m 2.0GB d11 d12 (maint)
d11 s 2.0GB c3t3d0s1
d12 s 2.0GB c3t2d0s1 (maint)
d0 m 8.0GB d1 d2 (maint)
d1 s 8.0GB c3t3d0s0
d2 s 8.0GB c3t2d0s0 (maint)
[02:31:42] charihar@thunderbird:/home/charihar
Now we need to replace the disk.
Procedure for disk replacement.
Get the disk replaced with a same capacity disk.
Delete the metadb from faulty disk.
$metadb -d c3t2d0s7
Detach and clear faulty sub-mirrors
$metadetach -f d0 d1
$metadetach -f d10 d11
$metadetach -f d30 d31
$metadetach -f d40 d41
$metadetach -f d60 d61
$metaclear d1
$metaclear d11
$metaclear d31
$metaclear d41
$metaclear d61
Re-Boot your system with Good Disk:
If your First disk failed, and second disk is in Good condition; follow the below procedure.
1. Check you have active boot enabled on Disk2; (format; fdisk (select option 2 to make disk active)
2. Install grub if you have not installed alreday on Disk2
$/usr/sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c3t3d0s0
4. Edit /boot/solaris/bootenv.rc file and point bootpath to Good disk.sd@3,0,a
setprop bootpath '/pci@0,0/pci1022,7450@2/pci1000,3060@3/sd@3,0:a'
ls -l /dev/dsk/c3t3d0s0
lrwxrwxrwx 1 root root 62 Dec 20 2007 /dev/dsk/c3t3d0s0 -> ../../devices/pci@7b,0/pci1022,7458@11/pci1000,3060@2/sd@3,0:a
3. Reboot and press F2 - Go to BIOS and Change First boot disk as Good Disk, Disk2
4. Now you are good to boot with Second disk.
Once you are able to boot to OS with Good Disk.
Create similar partitions on New Disk.
$prtvtoc /dev/rdsk/c3t3d0s0|fmthard -s - /dev/rdsk/c3t2d0s0
Create metadb
$metadb -afc3 c3t2d0s7
Add metainit to new disk slices.
$metainit -f d1 1 1 c3t2d0s0
$metainit -f d11 1 1 c3t2d0s1
$metainit -f d31 1 1 c3t2d0s3
$metainit -f d41 1 1 c3t2d0s4
$metainit -f d61 1 1 c3t2d0s6
Now Attach New sub mirrors to Mirror.
$metattach d0 d1
$metattach d10 d11
$metattach d30 d31
$metattach d40 d41
$metattach d60 d61
Check the status with metastat -c
+$ metastat -c
d60 m 120GB d61 d62 (resync-0%)
d61 s 120GB c3t3d0s6
d62 s 120GB c3t2d0s6
d40 m 2.0GB d41 d42 (resync-64%)
d41 s 2.0GB c3t3d0s4
d42 s 2.0GB c3t2d0s4
d30 m 4.0GB d31 d32 (resync-33%)
d31 s 4.0GB c3t3d0s3
d32 s 4.0GB c3t2d0s3
d10 m 2.0GB d11 d12 (resync-75%)
d11 s 2.0GB c3t3d0s1
d12 s 2.0GB c3t2d0s1
d0 m 8.0GB d1 d2 (resync-20%)
d1 s 8.0GB c3t3d0s0
d2 s 8.0GB c3t2d0s0
[00:39:55] charihar:/home/charihar
$Do a final restart after completing sync.
Live command examples.
bash-3.00# metadetach -f d10 d11
d10: submirror d11 is detached
bash-3.00# metaclear d11
d11: Concat/Stripe is cleared
bash-3.00#
bash-3.00# metainit d10 -m d11
d10: Mirror is setup
bash-3.00# metainit -f d31 1 1 c3t3d0s3
d31: Concat/Stripe is setup
bash-3.00# metainit d30 -m d31
d30: Mirror is setup
bash-3.00# metainit d41 -f d41 1 1 c3t3d0s4
d41: Concat/Stripe is setup
bash-3.00# metainit d40 -m d41
d40: Mirror is setup
bash-3.00# metainit f -f d61 1 1 c3t3d0s6
d61: Concat/Stripe is setup
bash-3.00# metainit d60 d -m d61
d60: Mirror is setup
bash-3.00#
bash-3.00# metattach d0 d2 d10 d12
d10: submirror d12 is attached
bash-3.00# metattach d10 d1230 d1232
d30: submirror d32 is attached
bash-3.00# metattach d30 d3240 d3242
d40: submirror d42 is attached
bash-3.00# metattach d40 d4260 d4262
d60: submirror d62 is attached
bash-3.00#
Subscribe to:
Posts (Atom)