Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

22.5. DASD 추가

다음은 DASD 볼륨을 추가하는 방법의 예입니다.
참고
VM에서 실행되는 경우 장치가 연결되어 있거나 Linux 시스템에 연결되어 있는지 확인합니다.
CP LINK RHEL4X 4B2E 4B2E MR
DASD 4B2E LINKED R/W

절차 22.1. 온라인 디스크 가져오기

  1. cd 명령을 사용하여 해당 볼륨을 나타내는 /sys/ 디렉터리로 변경합니다.
    # cd /sys/bus/ccw/drivers/dasd-eckd/0.0.4b2e/
    # ls -l
    total 0
    -r--r--r--  1 root root 4096 Aug 25 17:04 availability
    -rw-r--r--  1 root root 4096 Aug 25 17:04 cmb_enable
    -r--r--r--  1 root root 4096 Aug 25 17:04 cutype
    -rw-r--r--  1 root root 4096 Aug 25 17:04 detach_state
    -r--r--r--  1 root root 4096 Aug 25 17:04 devtype
    -r--r--r--  1 root root 4096 Aug 25 17:04 discipline
    -rw-r--r--  1 root root 4096 Aug 25 17:04 online
    -rw-r--r--  1 root root 4096 Aug 25 17:04 readonly
    -rw-r--r--  1 root root 4096 Aug 25 17:04 use_diag
  2. 다음으로, 이미 온라인 상태인지 확인하십시오:
    # cat online
    0
  3. 온라인 상태가 아닌 경우 다음 명령을 실행하여 온라인 상태로 전환합니다.
    # echo 1 > online
    # cat online
    1
  4. 다음과 같이 액세스 중인 devnode 블록을 확인합니다.
    # ls -l
    total 0
    -r--r--r--  1 root root 4096 Aug 25 17:04 availability
    lrwxrwxrwx  1 root root    0 Aug 25 17:07 block -> ../../../../block/dasdb
    -rw-r--r--  1 root root 4096 Aug 25 17:04 cmb_enable
    -r--r--r--  1 root root 4096 Aug 25 17:04 cutype
    -rw-r--r--  1 root root 4096 Aug 25 17:04 detach_state
    -r--r--r--  1 root root 4096 Aug 25 17:04 devtype
    -r--r--r--  1 root root 4096 Aug 25 17:04 discipline
    -rw-r--r--  1 root root    0 Aug 25 17:04 online
    -rw-r--r--  1 root root 4096 Aug 25 17:04 readonly
    -rw-r--r--  1 root root 4096 Aug 25 17:04 use_diag
    이 예에서와 같이 장치 4B2E는 /dev/dasdb 로 액세스됩니다.
또는 온라인으로 디스크를 가져오기 위한 권장 방법(자동으로)은 다음과 같은 간단한 명령을 사용하는 것입니다.
# chccwdev -e 4b2e
디스크가 온라인 상태가 되면 /root 디렉토리로 다시 변경하고 장치를 포맷합니다.
# cd
# dasdfmt -b 4096 -d cdl -f /dev/dasdb -l LX4B2E -p -y

cyl    97 of  3338 |#----------------------------------------------|   2%
진행률 표시줄이 끝에 도달하고 형식이 완료되면 fdasd 를 사용하여 장치를 분할합니다.
# fdasd -a /dev/dasdb
auto-creating one partition for the whole disk...
writing volume label...
writing VTOC...
checking !
wrote NATIVE!
rereading partition table...
다음으로 새 파티션에 파일 시스템을 만듭니다.
# mke2fs -j /dev/dasdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
300960 inodes, 600816 blocks
30040 blocks (5.00%) reserved for the super user
First data block=0
19 block groups
32768 blocks per group, 32768 fragments per group
15840 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
새 파일 시스템을 마운트합니다.
# mount /dev/dasdb1 /opt
# mount
/dev/dasda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/dasdb1 on /opt type ext3 (rw)
파일 시스템이 IPL 시간에 마운트되도록 /etc/fstab 에 항목을 추가합니다.
# vi /etc/fstab
# cat /etc/fstab
LABEL=/                 /                       ext3    defaults
1 1
none                    /dev/pts                devpts  gid=5,mode=620
0 0
none                    /dev/shm                tmpfs   defaults
0 0
none                    /proc                   proc    defaults
0 0
none                    /sys                    sysfs   defaults
0 0
/dev/dasdb1             /opt                    ext3    defaults
1 2
/etc/modprobe.conf 에서 dasd_mod의 옵션 줄에 장치를 추가하십시오. 목록 끝에 새 장치를 추가해야 합니다. 그렇지 않으면 장치 번호 : devnode 매핑 및 파일 시스템이 켜져 있는 장치에 없습니다.
# vi /etc/modprobe.conf
# cat /etc/modprobe.conf
alias eth0 qeth
options dasd_mod dasd=201,4B2E
mkinitrd 를 다시 실행하여 modprobe.conf 의 변경 사항을 선택하여 다음 IPL 이후에 장치를 온라인 및 마운트할 수 있습니다.
아래 예제는 가독성과 인쇄 목적으로 약간 수정되었습니다. "(elf64-s390)"으로 끝나는 각 행은 /tmp/initrd.AR1182/lib/dasd_mod.ko(elf64-s390) 와 같이 공백이 없는 한 행으로 처리되어야 합니다.
# cd /boot
# mv initrd-2.6.7-1.451.2.3.img initrd-2.6.7-1.451.2.3.img.old
# mkinitrd -v initrd-2.6.7-1.451.2.3.img 2.6.7-1.451.2.3
Looking for deps of module ide-disk
Looking for deps of module dasd_mod
Looking for deps of module dasd_eckd_mod         dasd_mod
Looking for deps of module dasd_mod
Looking for deps of module dasd_fba_mod  dasd_mod
Looking for deps of module dasd_mod
Looking for deps of module ext3  jbd
Looking for deps of module jbd
Using modules:  ./kernel/drivers/s390/block/dasd_mod.ko
./kernel/drivers/s390/block/dasd_eckd_mod.ko
./kernel/drivers/s390/block/dasd_fba_mod.ko ./kernel/fs/jbd/jbd.ko
./kernel/fs/ext3/ext3.ko
Using loopback device /dev/loop0
/sbin/nash -> /tmp/initrd.AR1182/bin/nash
/sbin/insmod.static -> /tmp/initrd.AR1182/bin/insmod
copy from
/lib/modules/2.6.7-1.451.2.3/./kernel/drivers/s390/block/dasd_mod.ko
(elf64-s390) to 
/tmp/initrd.AR1182/lib/dasd_mod.ko(elf64-s390)
copy from
/lib/modules/2.6.7-1.451.2.3/./kernel/drivers/s390/block/dasd_eckd_mod.ko
(elf64-s390) to 
/tmp/initrd.AR1182/lib/dasd_eckd_mod.ko
(elf64-s390)
copy from
/lib/modules/2.6.7-1.451.2.3/./kernel/drivers/s390/block/dasd_fba_mod.ko
(elf64-s390) to 
/tmp/initrd.AR1182/lib/dasd_fba_mod.ko
(elf64-s390)
copy from
/lib/modules/2.6.7-1.451.2.3/./kernel/fs/jbd/jbd.ko(elf64-s390) to 
/tmp/initrd.AR1182/lib/jbd.ko(elf64-s390)
copy from
/lib/modules/2.6.7-1.451.2.3/./kernel/fs/ext3/ext3.ko(elf64-s390) to 
/tmp/initrd.AR1182/lib/ext3.ko(elf64-s390)
Loading module dasd_mod with options dasd=201,4B2E
Loading module dasd_eckd_mod
Loading module dasd_fba_mod
Loading module jbd
Loading module ext3
다음 IPL을 위해 zipl 을 실행하여 initrd 에 대한 변경 사항을 저장합니다.
# zipl -V
Using config file '/etc/zipl.conf'
Target device information
  Device..........................: 5e:00
  Partition.......................: 5e:01
  Device name.....................: dasda
  DASD device number..............: 0201
  Type............................: disk partition
  Disk layout.....................: ECKD/compatible disk layout
  Geometry - heads................: 15
  Geometry - sectors..............: 12
  Geometry - cylinders............: 3308
  Geometry - start................: 24
  File system block size..........: 4096
  Physical block size.............: 4096
  Device size in physical blocks..: 595416
Building bootmap '/boot//bootmap'
Building menu 'rh-automatic-menu'
Adding #1: IPL section 'linux' (default)
  kernel image......: /boot/vmlinuz-2.6.7-1.451.2.3 at 0x10000
  kernel parmline...: 'root=LABEL=/' at 0x1000
  initial ramdisk...: /boot/initrd-2.6.7-1.451.2.3.img at 0x800000
Preparing boot device: dasda (0201).
Preparing boot menu
  Interactive prompt......: disabled
  Menu timeout............: disabled
  Default configuration...: 'linux'
Syncing disks...
Done.