2017년 1월 31일 화요일

centos설치 후 공통 기본 세팅

1. ls 조회스타일 변경
# vi /etc/bashrc

내용추가
alias ls='ls --color=auto --time-style=long-iso'

2. bash 기본 문자셋 변경
# vi ~/.bashrc

내용추가
LANG=en_US.UTF8

3. data01 디스크 fdisk & 포맷 & 마운트 & fstab등록
# fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 1099.5 GB, 1099511627776 bytes, 268435456 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xa91c86a9

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1):
First sector (256-268435455, default 256):
Using default value 256
Last sector, +sectors or +size{K,M,G} (256-268435455, default 268435455):
Using default value 268435455
Partition 1 of type Linux and of size 1024 GiB is set

Command (m for help): p

Disk /dev/sdb: 1099.5 GB, 1099511627776 bytes, 268435456 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xa91c86a9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1             256   268435455  1073740800   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

# mkfs.xfs -f /dev/sdb
meta-data=/dev/sdb               isize=512    agcount=4, agsize=67108864 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=268435456, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=131072, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

# mkdir /data01
# mount /dev/sdb /data01
# vi /etc/fstab/
/dev/sdb                /data01                 xfs     defaults        0 0


4. ipv6 disable
# vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

# shutdown -rf now
재시작

# nmcli device show
재시작 후 네트워크 확인하여 ipv6없으면 적용됨


5. 내부 yum repository가 구축되어 있을 때 지정하기

. etc에 내부 yum repository를 참조하도록 repo설정 파일을 해당 경로로 지정한다.
vi /etc/yum.repos.d /birepos.repo

[birepos]
name=birepos Internal Repository
baseurl=http://10.203.9.208/repos/centos/iso/
enabled=1
gpgcheck=0



. yum repolist 목록에 뜨면 성공!
# yum repolist
...
birepos                        birepos Internal Repository    9,363
...


# mkdir -p /etc/yum.repos.d/ ~/etc/yum.repos.d/
[root@bidevkylinm1 yum.repos.d]# mv C*  ~/etc/yum.repos.d/
[root@bidevkylinm1 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
repo id                                                                                                                   repo name                                                                                                                                      status
birepos                                                                                                                   birepos Internal Repository                                                                                                                    9,363
repolist: 9,363

. repolist를 한개만 남겨두고 지워버리자
mkdir -p /etc/yum.repos.d/ ~/etc/yum.repos.d/
mv C* ~/etc/yum.repos.d/
yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
repo id            repo name          status
birepos            birepos              Internal Repository       9,363
repolist: 9,363

댓글 2개:

  1. 위 내용은 전체 다 저희 표준OS에서 다 안하셔도 되는 작업 입니다.
    업무에 참고 부탁 드립니다.

    답글삭제
    답글
    1. 역시~ ^^ 대부분 이미 표준으로 되어 있는거죠? 혹시 표준 lang설정이 utf-8 설정이 아닌 euc-kr 인지만 확인해주셔요~~

      삭제