
/dev/xvda2
우리는 Debian 이미지 처럼 마운트된 350GB의 임시 스토리지와 함께 제공되는 Amazon c1.medium 인스턴스를 사용하고 있습니다 . 이를 두 부분으로 분할해야 합니다. 그 중 하나는 80GB이고 다른 하나는 나머지 공간입니다. 실행 중인 인스턴스에서 해당 공간을 어떻게 분할할 수 있나요?
답변1
이 경우,lvm문제에 접근하는 가장 좋은 방법이며거기에 좋은 튜토리얼이는 lvm의 작동에 사용됩니다.
이 문제의 관점에서 lvm을 파악하고 나면 상황은 매우 간단해집니다.
# Create the partitions that are needed for scratch space
pvcreate /dev/xvda2
vgcreate /dev/vg_xvda2 /dev/xvda2
lvcreate -L 80G -n scratch /dev/vg_xvda2
lvcreate -l 100%FREE -n large_scratch /dev/vg_xvda2
# Format the scratch space
mkfs.ext3 /dev/vg_xvda2/scratch
mkfs.ext3 /dev/vg_xvda2/large_scratch
편의상 드라이브처럼 보이도록 생성된 파티션에 링크를 추가할 수 있습니다. 이 경우:
# Create a link to the scratch space allocated
ln -s /dev/vg_xvda2/scratch /dev/scratch
ln -s /dev/vg_xvda2/large_scratch /dev/large_scratch