반응형

parted 명령어를 통해서 32bit 는 16TB , 64bit 는 1EB까지 지원이 가능한 것으로 나온다.


parted를 통해 gpt로 21TB를 파티션을 나누고 ext4로 포맷을 하려고 하면 다음과 같은 상황을 만나게 된다.


Disk /dev/sdb: 21000.0 GB, 20999993032704 bytes  → 21TB

255 heads, 63 sectors/track, 2553103 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x00000000


  Device Boot   Start      End   Blocks   Id  System

/dev/sdb1            1   267350  2147483647+  ee  GPT

Partition 1 does not start on physical sector boundary.


[root@localhost ~]# mkfs.ext4 /dev/sdb1

mke2fs 1.41.12 (17-May-2010)

mkfs.ext4: Size of device /dev/sdb1 too big to be expressed in 32 bits

   using a blocksize of 4096.


16TB이상 포맷을 가능하게 하려면 다음과 같이 수정이 필요하다.


편집기로  /etc/mke2fs.conf에 들어가서


[defaults]

    base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr

    enable_periodic_fsck = 1

    blocksize = 4096

    inode_size = 256

    inode_ratio = 16384


[fs_types]

    ext3 = {

            features = has_journal

    }

    ext4 = {

            features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize

           auto_64-bit_support = 1 # add from jjkang 2016.01.07 ← 이 부분을 추가한다.

            inode_size = 256

    }

    ext4dev = {

            features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize

            inode_size = 256

            options = test_fs=1

    }


[git 설치]

필요 패키지 설치

yum install gcc

yum install kernel-devel

yum install zlib-devel

yum install openssl-devel

yum install perl

yum install expat-devel

yum install gettext-devel

yum install autoconf

yum install perl-ExtUtils-MakeMaker

yum install curl


wget http://curl.haxx.se/download/curl-7.46.0.tar.gz

tar zxvf curl-7.46.0.tar.gz

cd curl-7.46.0

./configure

make

make install


vi /etc/ld.so.conf에

/usr/local/lib 추가

ldconfig


wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.xz

unxz git-latest.xz

git-현재날짜.tar 파일이 생성

tar xvf git-현재날짜.tar

cd git-현재날짜/

./configure --with-curl/usr/local

make

make install


git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git

cd e2fsprogs

mkdir build ; cd build/

../configure

make

make install


** mke2fs는 -i 라는 옵션을 이용하여 아이노드 당 바이트 수 (bytes-per-inode)를 지정하여 파일시스템을 생성할 수 있다. 이때 주의할 점은 -i 옵션으로 주어지는 값은 최소 1024이상은 되어야한다는 것이다. -i 옵션없이 그냥 mke2fs가 사용되면 기본값으로 4096이 주어지게 된다.


>> 1024 * 128 = 131072

Warning : The exitsting disk label on /dev/sdb will be destoryed and all data on the disk will be lost. Do you want to continue?

라는 경고창이 혹시 뜬다면, parted로 파티션을 다시 나누고 진행할 것


[root@localhost build]# mke2fs -O 64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -i 131072 /dev/sdb1

mke2fs 1.43-WIP (18-May-2015)


Warning: the fs_type huge is not defined in mke2fs.conf


Creating filesystem with 5126950912 4k blocks and 160218112 inodes

Filesystem UUID: 5c151619-d2cf-40af-8988-6f4cb400a3e1

Superblock backups stored on blocks:

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

   4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

   102400000, 214990848, 512000000, 550731776, 644972544, 1934917632,

   2560000000, 3855122432


Allocating group tables: done                       

Writing inode tables: done                       

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done    


This filesystem will be automatically checked every 24 mounts or

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


하면 정상적으로 생성이 된다.




반응형

+ Recent posts