Wednesday, June 29, 2011

Sub-Disk Administration


SUB-DISKS:

1. Volume manager disk can be divided into one or more sub-disks.
2. Is a collection of contiguous blocks that represent a specific portion of a volume manager disk, which is mapped to a specific regions of physical disk.
3. Is a subsection of a disk's public region.
4. Is the smallest unit of storage in volume manager.
5. Conceptually, a sub-disk is similar to a partition.
6. Max size of a sub-disk is the size of the vxdisk.
7. Can create 4096 sub-disks/vmdisk.
8. Sub-disk cannot be shared among two plexes.


ADMINISTERING SUB-DISKS:

1. Creating the subdiks
2. Viewing the subdisk information
3. Associating the subdisk with the plex
4. Dissociating the subdisk from the plex
5. Deleting the subdisk



Creating sub disk:


Output:

bash-3.00# vxmake -g datadg sd datadg01-01 datadg01,0,8000
bash-3.00# vxprint -g datadg -st
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE

sd datadg01-01 - datadg01 0 8000 - c1t12d0 ENA


bash-3.00# vxprint -g datadg -st
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE

sd datadg01-01 - datadg01 0 8000 - c1t12d0 ENA


bash-3.00# vxmake -g oradg sd oradg02-05 oradg01,6291456,2g

bash-3.00# vxprint -g oradg -st
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE

sd oradg02-01 vol1-01 oradg02 0 4194304 0 c1t10d0 ENA
sd oradg02-02 - oradg01 0 2097152 - c1t11d0 ENA
sd oradg02-04 - oradg01 2097152 4194304 - c1t11d0 ENA
sd oradg02-05 - oradg01 6291456 4194304 - c1t11d0 ENA


Viewing the sub disk information:

Output:

bash-3.00# vxprint -st
Disk group: oradg

SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE

sd oradg02-01 vol1-01 oradg02 0 4194304 0 c1t10d0 ENA

Disk group: newdg

SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE

sd newdg01-01 newvol1-01 newdg01 0 2097152 0 c1t9d0 ENA



bash-3.00# vxprint -g newdg -s
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
sd newdg01-01 newvol1-01 ENABLED 2097152 0 - - -



bash-3.00# vxprint -g newdg -l newdg01-01
Subdisk: newdg01-01
info: disk=newdg01 offset=0 len=2097152
assoc: vol=newvol1 plex=newvol1-01 (offset=0)
flags: enabled
device: device=c1t9d0s2 path=/dev/vx/dmp/c1t9d0s2 diskdev=272/26



Associating the sub disk to the plex:

Output:


Case-1:

bash-3.00# vxmake -g oradg plex oradgvol01-01 sd=oradg02-02,oradg02-04
bash-3.00# vxprint -g oradg -pt
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE

pl oradgvol01-01 - DISABLED - 6291456 CONCAT - RW
pl vol1-01 vol1 ENABLED ACTIVE 4194304 CONCAT - RW


Case-2:

bash-3.00# vxsd -g oradg assoc oradgvol01-01 oradg02-05 oradg02-06

bash-3.00# vxprint -g oradg -st
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE

sd oradg02-01 vol1-01 oradg02 0 4194304 0 c1t10d0 ENA
sd oradg02-02 oradgvol01-01 oradg01 0 2097152 0 c1t11d0 ENA
sd oradg02-04 oradgvol01-01 oradg01 2097152 4194304 2097152 c1t11d0 ENA
sd oradg02-05 oradgvol01-01 oradg01 6291456 4194304 6291456 c1t11d0 ENA
sd oradg02-06 oradgvol01-01 oradg02 10485760 2097152 10485760 c1t10d0 ENA



Deleting/the sub disk:


Output:

bash-3.00# vxedit -g datadg rm datadg01-01

bash-3.00# vxsd -g oradg -o rm dis oradg02-06

bash-3.00# vxprint -g oradg -st
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE

sd oradg02-01 vol1-01 oradg02 0 4194304 0 c1t10d0 ENA
sd oradg02-02 oradgvol01-01 oradg01 0 2097152 0 c1t11d0 ENA
sd oradg02-04 oradgvol01-01 oradg01 2097152 4194304 2097152 c1t11d0 ENA
sd oradg02-05 oradgvol01-01 oradg01 6291456 4194304 6291456 c1t11d0 ENA

bash-3.00# vxsd -g oradg dis oradg02-05
bash-3.00# vxprint -g oradg -st
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE

sd oradg02-01 vol1-01 oradg02 0 4194304 0 c1t10d0 ENA
sd oradg02-02 oradgvol01-01 oradg01 0 2097152 0 c1t11d0 ENA
sd oradg02-04 oradgvol01-01 oradg01 2097152 4194304 2097152 c1t11d0 ENA
sd oradg02-05 - oradg01 6291456 4194304 - c1t11d0 EN



Note:
Sun Fire X 2100 image is posted.

Wednesday, June 22, 2011

Unix Shell Basics


Unix Shell Basics: Interview tips on fundamentals

Here we discuss on the Bash shell fundamentals.


bash-3.00# last
root pts/3 :0.0 Wed Jun 22 13:03 still logged in
root console :0 Wed Jun 22 12:57 still logged in
reboot system boot Wed Jun 22 12:49
reboot system down Mon Jun 20 18:24
root pts/3 :0.0 Sun Jun 19 20:25 - 18:23 (21:58)
root console :0 Sun Jun 19 20:25 - 18:23 (21:58)
root pts/3 :0.0 Sun Jun 19 20:15 - 20:24 (00:09)
root console :0 Sun Jun 19 20:10 - 20:25 (00:14)
reboot system boot Sun Jun 19 20:00
reboot system down Sun Jun 19 19:58
root pts/3 :0.0 Sun Jun 19 19:56 - 19:57 (00:00)
root console :0 Sun Jun 19 19:54 - 19:57 (00:03)
reboot system boot Sun Jun 19 19:45
wtmp begins Sun Jun 19 19:45

For eg, if we execute the above command, the system displays the information related to who is currently logged in, in which console the user is logged in, previous user’s login time and terminal worked, when the system is restarted.

Also the information is read from the file /var/adm/wtmpx


Note:
The format of the file is,
bash-3.00# file wtmpx
wtmpx: data



bash-3.00# last reboot
reboot system boot Wed Jun 22 12:49
reboot system down Mon Jun 20 18:24
reboot system boot Sun Jun 19 20:00
reboot system down Sun Jun 19 19:58
reboot system boot Sun Jun 19 19:45
wtmp begins Sun Jun 19 19:45

If we execute the above command, the system displays the information only about, when the system is rebooted.


bash-3.00# last | grep reboot
reboot system boot Wed Jun 22 12:49
reboot system down Mon Jun 20 18:24
reboot system boot Sun Jun 19 20:00
reboot system down Sun Jun 19 19:58
reboot system boot Sun Jun 19 19:45

If we execute the above command, the system displays only when the system is rebooted.
Here pine-line (pipe-line) takes the output of last as the input for the command grep.
Note: Generally the syntax of the command grep is as follows,

$ grep
Eg, $ grep root /etc/passwd.


But in the above eg, we failed to mention the name/path of the file, hence the output of ‘last’ command will be taken as input for ‘grep’ command.


Also we can note the output of the above command is similar to the output of # last reboot.




bash-3.00# last;reboot
root pts/3 :0.0 Wed Jun 22 13:03 still logged in
root console :0 Wed Jun 22 12:57 still logged in
reboot system boot Wed Jun 22 12:49
reboot system down Mon Jun 20 18:24
root pts/3 :0.0 Sun Jun 19 20:25 - 18:23 (21:58)
root console :0 Sun Jun 19 20:25 - 18:23 (21:58)
root pts/3 :0.0 Sun Jun 19 20:15 - 20:24 (00:09)
root console :0 Sun Jun 19 20:10 - 20:25 (00:14)
reboot system boot Sun Jun 19 20:00
reboot system down Sun Jun 19 19:58
root pts/3 :0.0 Sun Jun 19 19:56 - 19:57 (00:00)
root console :0 Sun Jun 19 19:54 - 19:57 (00:03)
reboot system boot Sun Jun 19 19:45
wtmp begins Sun Jun 19 19:45

If we execute the above command, the system displays the information related to who is currently logged in, in which console the user is logged in, previous user’s login time and terminal worked, when the system is restarted and then reboot the system. This is because the two commands are separated by semi-colon (;).



bash-3.00# last | reboot
Now, if we execute the above command, the output of last command will be taken, and the system reboot.




Note: Sun Fire 3500 Back Panel View is displayed in this page.