Как изменить размер раздела EXT
Шаг 1 - Подготовка
Загрузите сервер в Rescue-систему.Проверьте текущую таблицу разделов (она должна выглядеть следующим образом, в зависимости от модели):
fdisk -l
Disk /dev/sda: 102.4 GB, 102399737856 bytes
255 heads, 63 sectors/track, 12449 cylinders, total 199999488 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: 0x00051eb3
Device Boot Start End Blocks Id System
/dev/sda1 2048 52426752 26212352+ 83 Linux
255 heads, 63 sectors/track, 12449 cylinders, total 199999488 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: 0x00051eb3
Device Boot Start End Blocks Id System
/dev/sda1 2048 52426752 26212352+ 83 Linux
На всякий случай запомните начальный и конечный секторы, если что-либо пойдет не так.
Шаг 2 - Форматирование
Удалите раздел и создайте новый не его месте:fdisk /dev/sda
Command (m for help): d
Selected partition 1
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-199999487, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-199999487, default 199999487):
Using default value 199999487
Partition #1 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: N
Command (m for help): p
Disk /dev/sda: 102.4 GB, 102399737856 bytes
255 heads, 63 sectors/track, 12449 cylinders, total 199999488 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: 0x00051eb3
Device Boot Start End Blocks Id System
/dev/sda1 2048 199999487 99998720 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Selected partition 1
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-199999487, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-199999487, default 199999487):
Using default value 199999487
Partition #1 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: N
Command (m for help): p
Disk /dev/sda: 102.4 GB, 102399737856 bytes
255 heads, 63 sectors/track, 12449 cylinders, total 199999488 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: 0x00051eb3
Device Boot Start End Blocks Id System
/dev/sda1 2048 199999487 99998720 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Шаг 3 - Проверка файловой системы
Проверьте файловую систему с помощью:e2fsck -f -C0 /dev/sda1
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 26283/1638400 files (5.6% non-contiguous), 283813/6553088 blocks
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 26283/1638400 files (5.6% non-contiguous), 283813/6553088 blocks
Шаг 4 - Изменение размера файловой системы
Выполните изменение размера файловой системы:resize2fs /dev/sda1
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sda1 to 24999680 (4k) blocks.
The filesystem on /dev/sda1 is now 24999680 blocks long.
Resizing the filesystem on /dev/sda1 to 24999680 (4k) blocks.
The filesystem on /dev/sda1 is now 24999680 blocks long.
Сделайте перезагрузку и проверьте, стал ли диск больше.
Комментариев 0