노트

노트

이것은 내 현재 디스크 파티션 구성입니다.

fd0      2:0    1    4K  0 disk 
sda      8:0    0  150G  0 disk 
├─sda1   8:1    0  200M  0 part /boot
├─sda2   8:2    0  3.9G  0 part 
├─sda3   8:3    0 34.2G  0 part /
└─sda4   8:4    0  1.8G  0 part /home
sdb      8:16   0   20G  0 disk 
sr0     11:0    1 1024M  0 rom
  1. sda3현재 루트 파티션의 크기를 조정 하고 에서 사용 가능한 공간으로 확장하고 싶습니다 sdb. 그 후 루트 파티션의 크기는 54.2G가 됩니다.

  2. 이 여유 공간(할당되지 않음)이 디스크와 디스크 끝에 있는 경우(섹터 수가 너무 멀리 떨어져 있고 제한을 초과하는 경우) 누가 문제를 해결하기 위해 다른 조치를 취할 수 있습니까?

------편집자------자세히 알아보기:

fdisk를 통해:

# fdisk -l
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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 /dev/sda: 150 GiB, 161061273600 bytes, 314572800 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
Disklabel type: dos
Disk identifier: 0x2971e5ee

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048   411647   409600  200M 83 Linux
/dev/sda2         411648  8515575  8103928  3.9G 82 Linux swap / Solaris
/dev/sda3        8515584 80195583 71680000 34.2G 83 Linux                                                                                                                                       
/dev/sda4       80195584 83886079  3690496  1.8G 83 Linux

헤어짐으로써:

(parted) p free                                                           
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 161GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system     Flags
        32.3kB  1049kB  1016kB           Free Space
 1      1049kB  211MB   210MB   primary  ext2            boot
 2      211MB   4360MB  4149MB  primary  linux-swap(v1)
        4360MB  4360MB  4096B            Free Space
 3      4360MB  41.1GB  36.7GB  primary  ext4
 4      41.1GB  42.9GB  1890MB  primary  ext4
        42.9GB  161GB   118GB            Free Space

노트

할당되지 않은 섹터는 개별적으로 재그룹화되지 않습니다.

답변1

다음 명령을 사용하십시오증가 감소파일 시스템 크기.

resize2fs device [new_size]

이것을 참조하세요협회자세한 내용은

관련 정보