Skip to content

zLinux: Add & Configure New Disk

Objective: New disks are added to the machine. I need to configure and integrate them into existing LVM partition.

OS: RHEL 5.9
Kernel: 2.6.18-274.el5
Related Documentation: https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-s390info-addDASD.html

The mainframe administrator has assigned me 6 disks and the disk name are ‘205’ – ’20e’. So, I need to find out the associated device name with the assigned disk,

[root@zlinux ~]# ls -l /sys/bus/ccw/drivers/dasd-eckd/0.0.0205/
total 0
-r--r--r-- 1 root root 4096 Apr  4 12:41 alias
-r--r--r-- 1 root root 4096 Apr  4 12:43 availability
lrwxrwxrwx 1 root root    0 Apr  4 12:41 block:dasdf -> ../../../../block/dasdf
lrwxrwxrwx 1 root root    0 Apr  4 12:43 bus -> ../../../../bus/ccw
-rw-r--r-- 1 root root 4096 Apr  4 12:43 cmb_enable
-r--r--r-- 1 root root 4096 Apr  4 12:43 cutype
-r--r--r-- 1 root root 4096 Apr  4 12:43 devtype
-r--r--r-- 1 root root 4096 Apr  4 12:41 discipline
lrwxrwxrwx 1 root root    0 Apr  4 12:41 driver -> ../../../../bus/ccw/drivers/dasd-eckd
-rw-r--r-- 1 root root 4096 Apr  4 12:43 eer_enabled
-rw-r--r-- 1 root root 4096 Apr  4 12:43 erplog
-rw-r--r-- 1 root root 4096 Apr  4 12:43 failfast
-rw-r--r-- 1 root root 4096 Apr  4 12:43 last_known_reservation_state
-r--r--r-- 1 root root 4096 Apr  4 12:43 modalias
-rw-r--r-- 1 root root 4096 Apr  4 12:41 online
-rw-r--r-- 1 root root 4096 Apr  4 12:41 readonly
-rw-r--r-- 1 root root 4096 Apr  4 12:43 reservation_policy
-r--r--r-- 1 root root 4096 Apr  4 12:43 status
lrwxrwxrwx 1 root root    0 Apr  4 12:43 subsystem -> ../../../../bus/ccw
--w------- 1 root root 4096 Apr  4 12:43 uevent
-r--r--r-- 1 root root 4096 Apr  4 12:41 uid
-rw-r--r-- 1 root root 4096 Apr  4 12:43 use_diag
-r--r--r-- 1 root root 4096 Apr  4 12:43 vendor

To check in reverse,

[root@zlinux ~]# ls -l /sys/block/dasdf
total 0
drwxr-xr-x 3 root root    0 Apr  4 13:57 dasdf1
-r--r--r-- 1 root root 4096 Apr  4 12:41 dev
lrwxrwxrwx 1 root root    0 Apr  4 12:54 device -> ../../devices/css0/0.0.0018/0.0.0205
drwxr-xr-x 2 root root    0 Apr  2 09:37 holders
drwxr-xr-x 3 root root    0 Apr  2 09:37 queue
-r--r--r-- 1 root root 4096 Apr  4 13:58 range
-r--r--r-- 1 root root 4096 Apr  4 13:58 removable
-r--r--r-- 1 root root 4096 Apr  4 12:41 size
drwxr-xr-x 2 root root    0 Apr  2 09:37 slaves
-r--r--r-- 1 root root 4096 Apr  4 13:58 stat
lrwxrwxrwx 1 root root    0 Apr  4 13:58 subsystem -> ../../block
--w------- 1 root root 4096 Apr  4 13:58 uevent

Check the disk status, make sure it is online & active.

[root@zlinux ~]# cat /sys/bus/ccw/drivers/dasd-eckd/0.0.0205/online
1
[root@zlinux ~]# lsdasd
Bus-ID     Status      Name      Device  Type  BlkSz  Size      Blocks
==============================================================================
0.0.0200   active      dasda     94:0    ECKD  4096   23033MB   5896620
0.0.0201   active      dasdb     94:4    ECKD  4096   23033MB   5896620
0.0.0202   active      dasdc     94:8    ECKD  4096   23033MB   5896620
0.0.0203   active      dasdd     94:12   ECKD  4096   23033MB   5896620
0.0.0204   active      dasde     94:16   ECKD  4096   23033MB   5896620
0.0.0205   active      dasdf     94:20   ECKD  4096   23033MB   5896620
0.0.0206   active      dasdg     94:24   ECKD  4096   23033MB   5896620
0.0.0207   active      dasdh     94:28   ECKD  4096   23033MB   5896620
0.0.0208   active      dasdi     94:32   ECKD  4096   23033MB   5896620
0.0.0209   active      dasdj     94:36   ECKD  4096   23033MB   5896620
0.0.020a   active      dasdk     94:40   ECKD  4096   23033MB   5896620

In this situation the newly added disks are ‘dasdf’ – ‘dasdk’.

Format the disk,

[root@zlinux ~]# dasdfmt -b 4096 -d cdl -f /dev/dasdf -l LX4B2E -p -y -v
Retrieving disk geometry...
Drive Geometry: 32759 Cylinders * 15 Heads =  491385 Tracks

I am going to format the device /dev/dasdg in the following way:
   Device number of device : 0x206
   Labelling device        : yes
   Disk label              : VOL1
   Disk identifier         : LX4B2E
   Extent start (trk no)   : 0
   Extent end (trk no)     : 491384
   Compatible Disk Layout  : yes
   Blocksize               : 4096
Formatting the device. This may take a while (get yourself a coffee).
Detaching the device...
Invalidate first track...

cyl 32759 of 32759 |##################################################| 100%

formatting tracks complete...
Revalidate first track...
Re-accessing the device...
Finished formatting the device.
Retrieving dasd information... ok
Writing empty bootstrap...
Writing label...
Writing VTOC... ok
Rereading the partition table... ok

Create Partition,

[root@zlinux ~]# fdasd -a /dev/dasdf
reading volume label ..: VOL1
reading vtoc ..........: ok

auto-creating one partition for the whole disk...
writing volume label...
writing VTOC...
rereading partition table...

If disk is not correctly formatted, we might stumble upon error message as below.

  • [root@zlinux ~]# fdasd -a /dev/dasdf
    
    fdasd error:  seek error
    Could not seek device '/dev/dasdf'.
    
  • [root@zlinux ~]# fdasd -a /dev/dasdg
    
    fdasd error:  Unsupported disk format
    /dev/dasdg is not formatted with z/OS compatible disk layout!
    

Since this is a repetitive task, I use 1-liner command for the rest of the disks.

for disk in {g..k}; do dasdfmt -b 4096 -d cdl -f /dev/dasd$disk -l LX4B2E -p -y -v; done
for disk in {f..k}; do fdasd -a /dev/dasd$disk; done

Create physical volume,

[root@zlinux ~]# for disk in {f..k}; do pvcreate /dev/dasd"$disk"1; done
  Writing physical volume data to disk "/dev/dasdf1"
  Physical volume "/dev/dasdf1" successfully created
  Writing physical volume data to disk "/dev/dasdg1"
  Physical volume "/dev/dasdg1" successfully created
  Writing physical volume data to disk "/dev/dasdh1"
  Physical volume "/dev/dasdh1" successfully created
  Writing physical volume data to disk "/dev/dasdi1"
  Physical volume "/dev/dasdi1" successfully created
  Writing physical volume data to disk "/dev/dasdj1"
  Physical volume "/dev/dasdj1" successfully created
  Writing physical volume data to disk "/dev/dasdk1"
  Physical volume "/dev/dasdk1" successfully created

The rest of the work (vgextend, lvextend, resize4fs) should be similar with normal x86 Linux.

Comments

Post a Comment

Your email is never published nor shared. Required fields are marked *