Centos ext4 mount 방법

Linux 2015. 11. 10. 10:06



Centos ext4 mount 방법

1. 시스템 기본정보 확인
[root@test /]# uname -a
Linux test 2.6.18-238.el5PAE #1 SMP Thu Jan 13 17:10:20 EST 2011 i686 i686 i386 GNU/Linux
[root@test /]#
[root@test /]#

2. 디스크의 파티션 확인
[root@test /]#
[root@test /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 9.7G 1.2G 8.1G 13% /
/dev/sda3 201G 188M 190G 1% /home
tmpfs 16G 0 16G 0% /dev/shm
[root@test /]#

3. 물리적인 디스크 확인
; 추가 장착된 /dev/sdb 를 ext4 파일시스템을 만들겠습니다.
[root@test /]#
[root@test /]# fdisk -l
Disk /dev/sda: 249.5 GB, 249510756352 bytes
255 heads, 63 sectors/track, 30334 cylinders
Units = cylinders of 16065 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1
1 1305 10482381 83 Linux
/dev/sda2 1306 3366 16554982+ 82 Linux swap / Solaris
/dev/sda3 3367 30334 216620460 83 Linux
Disk /dev/sdb: 249.5 GB, 249510756352 bytes
255 heads, 63 sectors/track, 30334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
[root@test /]#
[root@test /]#

4. 새로운 파티션 생성
[root@test /]#
[root@test /]# fdisk /dev/sdb
The number of cylinders for this disk is set to 30334.
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-30334, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-30334, default 30334):
Using default value 30334

Command (m for help): p
Disk /dev/sdb: 249.5 GB, 249510756352 bytes
255 heads, 63 sectors/track, 30334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 30334 243657823+ 83 Linux

Command (m for help): w <- 저장은 꼭! 합시다^^
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@test /]#

5. 생성된 파티션 확인
[root@test /]#
[root@test /]# fdisk -l
Disk /dev/sda: 249.5 GB, 249510756352 bytes
255 heads, 63 sectors/track, 30334 cylinders
Units = cylinders of 16065 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1
1 1305 10482381 83 Linux
/dev/sda2 1306 3366 16554982+ 82 Linux swap / Solaris
/dev/sda3 3367 30334 216620460 83 Linux
Disk /dev/sdb: 249.5 GB, 249510756352 bytes
255 heads, 63 sectors/track, 30334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 30334 243657823+ 83 Linux
[root@test /]#
[root@test /]#
[root@test /]#

6. ext4 파일시스템을 사용할 수 있게 e4fsprogs 를 설치
[root@test /]#
[root@test /]# yum install e4fsprogs

7. 새로 만든 파티션을 ext4 파일시스템으로 생성
[root@test /]#
[root@test /]# mkfs.ext4 /dev/sdb1
mke4fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
15228928 inodes, 60914455 blocks
3045722 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1859 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. Use tune4fs -c or -i to override.
[root@test /]#

8. 새로운 디렉토리(/data)에 마운트
[root@test /]#
[root@test /]# mkdir /data
[root@test /]#
[root@test /]# mount /dev/sdb1 /data
[root@test /]#
[root@test /]#
[root@test /]# df -Th


'Linux' 카테고리의 다른 글

파이썬으로 다운로드/업로드 속도 측정  (0) 2015.12.15
centos samba 설치  (1) 2015.12.15
mysql dump import 속도 개선  (1) 2015.10.30
php5.3 source install (php-fpm)  (2) 2015.10.30
php soap 모듈 추가  (0) 2015.10.30
Posted by pysany
,