라즈베리파이 리눅스 파티션 조절
8기가 메모리에 라즈베리파이를 설치했는데
알고보니 2기가만 쓰고있었다는 사실.
root@raspberrypi:/# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 1.8G 1.7G 0 100% /
/dev/root 1.8G 1.7G 0 100% /
devtmpfs 116M 0 116M 0% /dev
tmpfs 25M 244K 25M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 50M 0 50M 0% /run/shm
/dev/mmcblk0p1 56M 19M 38M 33% /boot
tmpfs 50M 0 50M 0% /tmp
파티션 리스트를 확인하고
root@raspberrypi:/# fdisk -l
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: 0x000c7b31
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/mmcblk0p2 122880 3788799 1832960 83 Linux
fdisk를 실행한다.
root@raspberrypi:/# fdisk -u -c /dev/mmcblk0
delete - 파티션2 - new - primary - 파티션2 - 시작섹터~종료섹터 순서로 입력한다.
Command (m for help): d
Partition number (1-4): 2
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-15523839, default 2048): 122880
Last sector, +sectors or +size{K,M,G} (122880-15523839, default 15523839): 15523839
그냥 enter 치면 default로 자동세팅된다.
저장하고 종료
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
그리고 재부팅.
파티션 재인식후 확인.
root@raspberrypi:~# resize2fs /dev/mmcblk0p2
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 1925120 blocks long.
root@raspberrypi:~# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 7.3G 1.7G 5.3G 25% /
/dev/root 7.3G 1.7G 5.3G 25% /
devtmpfs 116M 0 116M 0% /dev
tmpfs 25M 240K 25M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 50M 0 50M 0% /run/shm
/dev/mmcblk0p1 56M 19M 38M 33% /boot
tmpfs 50M 0 50M 0% /tmp
끝.
'Dev > linux' 카테고리의 다른 글
라즈베리파이 리눅스 아파치 톰캣 설치 (0) | 2014.01.21 |
---|---|
라즈베리파이 리눅스 ftp서버 설치 (0) | 2014.01.21 |
라즈베리파이 라즈비안 xbmc (6) | 2013.07.16 |
nslookup option , 사용법 (2) | 2011.06.15 |
linux favorite command (0) | 2011.03.08 |