변군이글루

[리눅스] 리눅스 2TB 이상 디스크 사용하기(GPT 파티션 설정) 본문

서___리눅스

[리눅스] 리눅스 2TB 이상 디스크 사용하기(GPT 파티션 설정)

변군 변군이글루 2016.03.02 18:41

 

리눅스 2TB 이상 디스크 사용하기(GPT 파티션 설정)

 

> MBR GPT의 비교표

참고URL : http://blog.naver.com/PostView.nhn?blogId=leekh8412&logNo=100132406507

 

1. 운영 중인 커널 버전 확인

# uname -a

Linux vm01 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 20:57:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

 

2. GPT Partition 사용가능 여부 체크

# cat /boot/config-2.6.32-504.23.4.el6.x86_64 | grep EFI | grep -v ^#

CONFIG_EFI=y

CONFIG_FB_EFI=y

CONFIG_UEFI_CPER=y

CONFIG_EFI_VARS=y

CONFIG_CACHEFILES=m

CONFIG_EFI_PARTITION=y

CONFIG_EARLY_PRINTK_EFI=y

 

3. GPT Partition 생성

# parted /dev/sdc

GNU Parted 2.1

Using /dev/sdc

Welcome to GNU Parted! Type 'help' to view a list of commands.

 

(parted) help                                                            

  align-check TYPE N                        check partition N for TYPE(min|opt) alignment

  check NUMBER                             do a simple check on the file system

  cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition

  help [COMMAND]                           print general help, or help on COMMAND

  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)

  mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partition NUMBER

  mkpart PART-TYPE [FS-TYPE] START END     make a partition

  mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system

  move NUMBER START END                    move partition NUMBER

  name NUMBER NAME                         name partition NUMBER as NAME

  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partiti

  quit                                     exit program

  rescue START END                         rescue a lost partition near START and END

  resize NUMBER START END                  resize partition NUMBER and its file system

  rm NUMBER                                delete partition NUMBER

  select DEVICE                            choose the device to edit

  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER

  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER

  unit UNIT                                set the default unit to UNIT

  version                                  display the version number and copyright information of GNU Parted

 

(parted) print                                                           

Error: /dev/sdc: unrecognised disk label

 

(parted) mklabel gpt

 

(parted) print

Model: HP LOGICAL VOLUME (scsi)

Disk /dev/sdc: 2700GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

 

Number  Start  End  Size  File system  Name  Flags

 

(parted) mkpart primary 0 2700GB

Warning: The resulting partition is not properly aligned for best performance.

Ignore/Cancel? Ignore                                                    

 

(parted) print                                                            

Model: HP LOGICAL VOLUME (scsi)

Disk /dev/sdc: 2700GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

 

Number  Start   End     Size    File system  Name     Flags

1      17.4kB  2700GB  2700GB               primary

 

(parted) quit                                                            

Information: You may need to update /etc/fstab.

 

4. ext4 파일시스템으로 포맷

# mkfs.ext4 /dev/sdc1

mke2fs 1.41.12 (17-May-2010)

/dev/sdc1 alignment is offset by 244736 bytes.

This may result in very poor performance, (re)-partitioning suggested.

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=64 blocks, Stripe width=192 blocks

164823040 inodes, 659290557 blocks

32964527 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

20120 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, 71663616, 78675968,

           102400000, 214990848, 512000000, 550731776, 644972544

 

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 21 mounts or

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

 

5. 마운트 포인트 설정

# blkid | grep /dev/sdc

/dev/sdc1: UUID="02a767df-e1ee-4e23-9d1e-9370d3a1b55b" TYPE="ext4"

 

# vi /etc/fstab

#/dev/sdc1

UUID=02a767df-e1ee-4e23-9d1e-9370d3a1b55b /app2                    ext4    defaults        0 0

 

 

 


0 Comments
댓글쓰기 폼