'리눅스'에 해당되는 글 2건

  1. 2008.10.22 Linux NFS 설정 방법 by 지영아빠
  2. 2008.10.22 볼륨 관련등의 테스트를 위한 볼륨 구성(onLinux) by 지영아빠
Linux NFS 설정 방법  

nfs는 원격으로 다른 컴퓨터의 디렉토리를 액세스 하는데 사용된다.


설정 파일 편집
/etc/exports 파일을 편집한다.
/home/cky *(rw,no_root_squash)
이런 식으로 적어준 디렉토리는 nfs로 마운트 할 수 있다.


nfsd 재시작
# /etc/init.d/nfs restart
설정 파일을 편집한 후에는 nfsd를 재시작 하거나 mountfs커맨드를 실행시켜준다.
# exportfs -a
# exportfs /home/cky 192.168.10.0/255.255.255.0


nfs 연결
다른 컴퓨터에서 설정해 놓은 컴퓨터의 디렉토리를 연결하려면 아래와 같이 한다.
# mount -t nfs ip address:/home/cky /mnt/nfs
mnt/nfs에 다른 컴퓨터의 /home/cky가 마운트된다.


서버의 nfs 설정 확인
특정 호스트에 nfs로 연결할 수 있는 디렉토리 정보를 알아볼 수 있다.
다음과 같이 한다.

$ showmount -e localhost
Export list for localhost: /home/cky 192.168.10.0/255.255.255.0


기타

공유하는 시스템 간의 계정의 아이디가 같아야 됩니다.

예를 들어 두 시스템에 test라는 계정이 있으면 아이디 값이 한 시스템에서는 600이고 한 시스템에서는 700인 경우 아이디 숫자값으로 비교를 하기 때문에

서로 다른 아이디가 되어서 권한을 제대로 적용하기가 힘듭니다.

./etc/passwd 등을 수정하고 chown을 실행해서 아이디 숫자값을 맞추고 적용하시기 바랍니다.



*참고*
http://secrice.com/writing/2005/02/20/nfs+BCB3C1A4_1108892367.php

신고
Posted by 지영아빠

볼륨 관련등의 테스트를 위한 볼륨 구성(onLinux)

 

아래 자료는 저희 팀에서 제품을 개발하면서 볼륨그룹설정이 필요해서 따로 정리한 자료입니다.


1. 가정

새로 추가한 하드 디스크를 /dev/sdb로 가정

각 볼륨에 32기가 씩 할당

ProJobs 내의 볼륨 그룹을 다음과 같이 3개 그룹 5개 볼륨으로 생성

 

VolumeGroup

Volume

Path

SystemVolumes

System

/Volumes/System

DataVolumes

DV01

/Voumues/Data/DV01

DV02

/Voumues/Data/DV01

CompressedDataVolumes

CV01

/Voumues/CData/CV01

CV02

/Voumues/CData/CV01

 

2. fdisk 파티션 생성

 

[root@fw4testsvr2 ~]# fdisk /dev/sdb

 

The number of cylinders for this disk is set to 24321.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): p

 

Disk /dev/sdb: 200.0 GB, 200049647616 bytes

255 heads, 63 sectors/track, 24321 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 2

First cylinder (1-24321, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-24321, default 24321):

Using default value 24321

 

Command (m for help): p

 

Disk /dev/sdb: 200.0 GB, 200049647616 bytes

255 heads, 63 sectors/track, 24321 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb2               1       24321   195358401   83  Linux

 

Command (m for help): t

Selected partition 2

Hex code (type L to list codes): 8e

Changed system type of partition 2 to 8e (Linux LVM)

 

Command (m for help): p

 

Disk /dev/sdb: 200.0 GB, 200049647616 bytes

255 heads, 63 sectors/track, 24321 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb2               1       24321   195358401   8e  Linux LVM

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

3. 하드디스크에 Physical Volume 생성

 

[root@fw4testsvr2 ~]# pvcreate /dev/sdb2

  Physical volume "/dev/sdb2" successfully created

 

4. 생성한 Physical Volume 가지는 Volume Group 생성

 

[root@fw4testsvr2 ~]# vgcreate -s 8m Volumes /dev/sdb2

  Volume group "Voluems" successfully created

 

5. 생성한 Volume Group Logical Volume 생성

 

[root@fw4testsvr2 ~]# lvcreate -L 32g -n System Volumes

  Logical volume "System" created

[root@fw4testsvr2 ~]# lvcreate -L 32g -n DV01 Volumes

  Logical volume "DV01" created

[root@fw4testsvr2 ~]# lvcreate -L 32g -n DV02 Volumes

  Logical volume "DV02" created

[root@fw4testsvr2 ~]# lvcreate -L 32g -n CV01 Volumes

  Logical volume "CV01" created

[root@fw4testsvr2 ~]# lvcreate -L 32g -n CV02 Volumes

  Logical volume "CV02" created

[root@fw4testsvr2 ~]#

 

6. 생성한 LV 파일 시스템 생성

 

[root@fw4testsvr2 ~]# mkfs -t ext3 /dev/Volumes/System

[root@fw4testsvr2 ~]# mkfs -t ext3 /dev/Volumes/DV01

[root@fw4testsvr2 ~]# mkfs -t ext3 /dev/Volumes/DV02

[root@fw4testsvr2 ~]# mkfs -t ext3 /dev/Volumes/CV01

[root@fw4testsvr2 ~]# mkfs -t ext3 /dev/Volumes/CV02

mke2fs 1.40.2 (12-Jul-2007)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

4194304 inodes, 8388608 blocks

419430 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

256 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

       32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

       4096000, 7962624

 

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 25 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@fw4testsvr2 ~]#

 

7. mount point 생성

 

[root@fw4testsvr2 ~]# mkdir /Volumes

[root@fw4testsvr2 ~]# mkdir /Volumes/System

[root@fw4testsvr2 ~]# mkdir /Volumes/Data

[root@fw4testsvr2 ~]# mkdir /Volumes/Data/DV01

[root@fw4testsvr2 ~]# mkdir /Volumes/Data/DV02

[root@fw4testsvr2 ~]# mkdir /Volumes/CData

[root@fw4testsvr2 ~]# mkdir /Volumes/CData/CV01

[root@fw4testsvr2 ~]# mkdir /Volumes/CData/CV02

[root@fw4testsvr2 ~]#

 

8. Volume mount

 

[root@fw4testsvr2 ~]#mount /dev/Volumes/System /Volumes/System

[root@fw4testsvr2 ~]#mount /dev/Volumes/DV01    /Volumes/Data/DV01

[root@fw4testsvr2 ~]#mount /dev/Volumes/DV02    /Volumes/Data/DV02

[root@fw4testsvr2 ~]#mount /dev/Volumes/CV01    /Volumes/CData/CV01

[root@fw4testsvr2 ~]#mount /dev/Volumes/CV02    /Volumes/CData/CV02

 

9. fstab 수정하여 자동으로 mount 되도록 한다.

 

마지막에 다음 내용을 추가

 

/dev/Volumes/System /Volumes/System     ext3 rw 0 2

/dev/Volumes/DV01   /Volumes/Data/DV01  ext3 rw 0 2

/dev/Volumes/DV02   /Volumes/Data/DV02  ext3 rw 0 2

/dev/Volumes/CV01   /Volumes/CData/CV01 ext3 rw 0 2

/dev/Volumes/CV02   /Volumes/CData/CV02 ext3 rw 0 2

 

10. 3 ~ 8번까지 총정리한 명령어들

 

pvcreate /dev/sdb2

 

vgcreate -s 8m Volumes /dev/sdb2

 

lvcreate -L 32g -n System Volumes

lvcreate -L 32g -n DV01 Volumes

lvcreate -L 32g -n DV02 Volumes

lvcreate -L 32g -n CV01 Volumes

lvcreate -L 32g -n CV02 Volumes

 

mkfs -t ext3 /dev/Volumes/System

mkfs -t ext3 /dev/Volumes/DV01

mkfs -t ext3 /dev/Volumes/DV02

mkfs -t ext3 /dev/Volumes/CV01

mkfs -t ext3 /dev/Volumes/CV02

 

mkdir /Volumes

mkdir /Volumes/System

mkdir /Volumes/Data

mkdir /Volumes/Data/DV01

mkdir /Volumes/Data/DV02

mkdir /Volumes/CData

mkdir /Volumes/CData/CV01

mkdir /Volumes/CData/CV02

 

mount /dev/Volumes/System /Volumes/System

mount /dev/Volumes/DV01   /Volumes/Data/DV01

mount /dev/Volumes/DV02   /Volumes/Data/DV02

mount /dev/Volumes/CV01   /Volumes/CData/CV01

mount /dev/Volumes/CV02   /Volumes/CData/CV02

신고
Posted by 지영아빠

티스토리 툴바