raspberry pi2 os 설치시 초기 partition resize 하는법

페이지 정보

작성자 한태현 댓글 0건 조회 18,511회 작성일 16-03-25 17:05

본문

라즈베리 파이에 처음 os 를 설치 하였을때,설치파일에 따라 root partition에 2~4기가등으로 본래 SD카드 용량보다 적게 잡히는 경우가 있습니다.
이럴경우 해결 법입니다.

터미널에 fdisk -u -c /dev/mmcblk0  을 입력한뒤


p 명령으로 파티션을 확인,
Command (m for help): p

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000714e9

        Device Boot      Start        End      Blocks  Id  System
/dev/mmcblk0p1            8192      122879      57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880    3788799    1832960  83  Linux

늘릴 파티션인 mmcblk0p2 를 d명령으로 날립니다.

Command (m for help): d
Partition number (1-4): 2

그 뒤, 남는 용량만큼 n명령을 이용해 새로운 파티션을 잡아줍니다.

Command (m for help): n
Partition type:
  p  primary (1 primary, 0 extended, 3 free)
  e  extended
Select (default p):
Using default response p
Partition number (1-4, default 2):
Using default value 2
First sector (2048-15523839, default 2048): 122880
Last sector, +sectors or +size{K,M,G} (122880-15523839, default 15523839):
Using default value 15523839

w 를 눌러 저장, fdisk를 빠져나간뒤,

파티션 사이즈를 재 인식 시켜주고, 재부팅 합니다.

root@raspberrypi:~# resize2fs /dev/mmcblk0p2
resize2fs 1.42.4 (12-Jun-2012)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mmcblk0p2 to 1925120 (4k) blocks.
The filesystem on /dev/mmcblk0p2 is now 1925120 blocks long.

root@raspberrypi:~# reboot

Broadcast message from root@raspberrypi (pts/0) (Mon Jan 28 17:01:16 2013):
The system is going down for reboot NOW!
root@raspberrypi:~#
Connection closed by foreign host.

이때, 저의 경우엔 fdisk 를 나간뒤 resize2fs 명령을 바로 사용할 수없어
fdisk - reboot - resize2fs -reboot 의 순으로 했더니 문제 없이 잘 적용되는것을 보았습니다.

댓글목록

등록된 댓글이 없습니다.