
Увеличение раздела XFS
Вот незадача, на виртуальную машину выделили слишком малый раздел для контента!
Ладно хоть на отдельном винте.
Что же… После долгих упрашиваний администратора хостовой машины — мне таки расширили его.
[sam@centos-content ~]$ sudo parted /dev/xvdb GNU Parted 2.1 Using /dev/xvdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print free Model: Xen Virtual Block Device (xvd) Disk /dev/xvdb: 1100GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 752GB 752GB primary xfs 752GB 1100GB 348GB Free Space
Осталось только включить свободное место в раздел.
Первоначально я попробывал сделать через resize в parted:
(parted) resize WARNING: you are attempting to use parted to operate on (resize) a file system. parted's file system manipulation code is not as robust as what you'll find in dedicated, file-system-specific packages like e2fsprogs. We recommend you use parted only to manipulate partition tables, whenever possible. Support for performing most operations on most types of file systems will be removed in an upcoming release. Partition number? 1 Start? [32.3kB]? End? [752GB]? 1100GB No Implementation: Support for opening xfs file systems is not implemented yet.
но увы, не получилось.
Тогда, я решил сделать старым, странным, но всегда работающим способом.
Покажу этот способ на «старом добром» fdisk’е. Для начала, размонтируем диск. Если это не возможно — загрузимся с livecd.
Суть метода проста — удаляем раздел, НО не данные. тут же создаем новый раздел нужного размера (важно, чтобы начала нового раздела и старого совпадали). Далее просто — просто расширяем файловую систему.
[sam@centos-content ~]$ sudo fdisk /dev/xvdb WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units toNju sectors (command 'u'). Command (m for help): p Disk /dev/xvdb: 1099.5 GB, 1099511627776 bytes 255 heads, 63 sectors/track, 133674 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x5ef28a63 Device Boot Start End Blocks Id System /dev/xvdb1 1 91379 734001786 83 Linux Command (m for help): d Selected partition 1 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-133674, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-133674, default 133674): Using default value 133674 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [sam@centos-content ~]$ sudo fdisk /dev/xvdb 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): p Disk /dev/xvdb: 1099.5 GB, 1099511627776 bytes 255 heads, 63 sectors/track, 133674 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x5ef28a63 Device Boot Start End Blocks Id System /dev/xvdb1 1 133674 1073736373+ 83 Linux Command (m for help): quit [sam@centos-content ~]$ sudo xfs_growfs /dev/xvdb1 xfs_growfs: /dev/xvdb1 is not a mounted XFS filesystem [sam@centos-content ~]$ sudo mount -a [sam@centos-content ~]$ sudo xfs_growfs /dev/xvdb1 meta-data=/dev/xvdb1 isize=256 agcount=4, agsize=45875136 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 data = bsize=4096 blocks=183500446, imaxpct=25 = sunit=64 swidth=64 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal bsize=4096 blocks=32768, version=2 = sectsz=512 sunit=64 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 183500446 to 268434093
Все просто =)