일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- RDS
- 센토스
- port
- DISK
- x-forward-for
- nvme
- VPN
- fdisk
- resize2fs
- terraform
- Windows
- Error
- 아마존
- DELETE
- centos
- AWS
- awscli
- EC2
- x-real-ip
- Linux
- onpromise
- xen
- 리눅스
- Query
- ntp
- EBS
- deragistration
- mysql
- 인스턴스타입
- ubuntu
- Today
- Total
Cloud
리눅스 용량 확장 명령어 resize2fs 사용법 (Nothing to do! 나올때) 본문
아래 접은 내용은 오래된 내용이고 최근에는 fdisk 를 사용하지 않고 growpart /dev/디바이스와파티션숫자까지 를 사용합니다.
이런식입니다.
[vitta@server ~]# growpart /dev/nvme1n1 1
CHANGED: partition=1 start=2048 old: size=2147481567 end=2147483615 new: size=4294965215 end=4294967263
[vitta@server ~]# resize2fs /dev/nvme1n1p1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/nvme1n1p1 is mounted on /home; on-line resizing required
old_desc_blocks = 128, new_desc_blocks = 256
The filesystem on /dev/nvme1n1p1 is now 536870651 blocks long.
[vitta@server ~]# growpart /dev/nvme1n1 1
CHANGED: partition=1 start=2048 old: size=2147481567 end=2147483615 new: size=4294965215 end=4294967263
[vitta@server ~]# resize2fs /dev/nvme1n1p1
resize2fs 1.42.9 (28-Dec-2013) Filesystem at /dev/nvme1n1p1 is mounted on /home; on-line resizing required old_desc_blocks = 128, new_desc_blocks = 256 The filesystem on /dev/nvme1n1p1 is now 536870651 blocks long.
자세한 내용은 아래내용 클릭!
2018.11.16 - [클라우드] - AWS EBS 데이터 손실 없는 nvme 디스크 확장
더보기 내용은 과거 root volume 증설 시 사용했던 명령집. 참고 안하셔도 됩니다.
EC2 의 CENTOS 의 경우 8G 정도의 Root 볼륨이 할당됩니다. 약간 작아 20G로 resize2fs 시켜 사용중이었는데 6.7 버전부터 resizefs /dev/xvda1 을 하면
The filesystem is already 2096896 blocks long. Nothing to do!
라는 메세지가 발생합니다.
이를 해결하기 위해 아래의 방법을 실행합니다.
이는 시작 섹터를 변경하여 이전 파티션을 삭제하고 동일한 파티션 번호를 새로 생성하게 하는 것입니다. 잘못될 경우 부팅에 실패할 수 있으므로, 사용 중인 시스템에서는 백업이 필수라 여겨집니다.
[root@cateye ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTxvda 202:0 0 20G 0 disk └─xvda1 202:1 0 8G 0 part /[root@cateye ~]# resize2fs /dev/xvda1
resize2fs 1.41.12 (17-May-2010)The filesystem is already 2096896 blocks long. Nothing to do!
[root@cateye ~]# resize2fs /dev/xvdaresize2fs 1.41.12 (17-May-2010)resize2fs: Device or resource busy while trying to open /dev/xvdaCouldn't find valid filesystem superblock.[root@cateye ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/xvda1 7.8G 943M 6.5G 13% /tmpfs 938M 0 938M 0% /dev/shm[root@cateye ~]# fdisk /dev/xvda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u').
Command (m for help): uChanging display/entry units to sectors
Command (m for help): p
Disk /dev/xvda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00057cbb
Device Boot Start End Blocks Id System/dev/xvda1 * 2048 16777215 8387584 83 Linux
Command (m for help): dSelected partition 1
Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First sector (63-41943039, default 63): 2048Last sector, +sectors or +size (2048-41943039, default 41943039): ENTERUsing default value 41943039
Command (m for help): p
Disk /dev/xvda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00057cbb
Device Boot Start End Blocks Id System/dev/xvda1 2048 41943039 20970496 83 Linux
Command (m for help): aPartition number (1-4): 1
Command (m for help): wThe 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 atthe next reboot or after you run partprobe(8) or kpartx(8)Syncing disks.[root@cateye ~]# reboot
Broadcast message from root@cateye
[root@cateye ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTxvda 202:0 0 20G 0 disk └─xvda1 202:1 0 20G 0 part /[root@cateye ~]$ df -hFilesystem Size Used Avail Use% Mounted on/dev/xvda1 20G 947M 18G 5% /tmpfs 938M 0 938M 0% /dev/shm
위의 내용은 제가 직접 실행한 내용이고, 아래에 설명을 따라했습니다. 가급적이면 원본 사이트에가서 참조하시기 바랍니다.
To expand on JD's self-accepted answer, here's exactly what to do:
df -h
#print the name of your boot partition
lsblk
#show info on all your block devices
You'll see from that output what the name of the disk is of your root partition. For example, you probably see something like this: xvde 202:64 0 32G 0 disk └─xvde1 202:65 0 8G 0 part /
Our goal is to make xvde1
use the whole available space from xvde
. Here's how your resize your partition:
fdisk /dev/xvda
(the disk name, not your partition) This enters into the fdisk
utility.
u
#Change the display to sectorsp
#Print infod
#Delete the partitionn
#New partitionp
#Primary partition1
#Partition number2048
#First sector- Press Enter to accept the default
p
#Print infoa
#Toggle the bootable flag1
#Select partition 1w
#Write table to disk and exit
Now, reboot your instance: reboot
After it comes back do:
resize2fs /dev/xvde1
(the name of your partition, not the block device)
And finally verify the new disk size: df -h
1 출처는 여기
http://stackoverflow.com/questions/26770655/ec2-storage-attached-at-sda-is-dev-xvde1-cannot-resize
'리눅스' 카테고리의 다른 글
fio 테스트 (0) | 2016.01.05 |
---|---|
기업용 리눅스 EPEL 설치 방법 (0) | 2016.01.04 |
리눅스 네트워크 대역폭 측정툴 iperf (0) | 2015.10.07 |
타임존, NTP 설정 (0) | 2015.07.02 |
세션 동시 접속 제한 해제 (0) | 2015.06.10 |