Index: head/en_US.ISO8859-1/books/handbook/disks/chapter.xml =================================================================== --- head/en_US.ISO8859-1/books/handbook/disks/chapter.xml +++ head/en_US.ISO8859-1/books/handbook/disks/chapter.xml @@ -256,10 +256,18 @@ Here, the last partition on the disk is the swap partition, but the second partition is the one that needs to be resized. Swap partitions only contain temporary data, so it can safely be - unmounted, deleted, and then recreated after resizing other - partitions. + unmounted, deleted, and then recreate the third partition after + resizing the second partition. - &prompt.root; swapoff /dev/ada0p3 + Disable the swap partition: + + &prompt.root; swapoff /dev/ada0p3 + + Delete the third partition, specified by the + flag, from the disk + ada0. + + &prompt.root; gpart delete -i 3 ada0 ada0p3 deleted &prompt.root; gpart show ada0 @@ -281,11 +289,14 @@ Resize the partition, leaving room to recreate a swap - partition of the desired size. This only modifies the size of - the partition. The file system in the partition will be - expanded in a separate step. + partition of the desired size. The partition to resize is + specified with , and the new desired size + with . Optionally, alignment of the + partition is controlled with . This only + modifies the size of the partition. The file system in the + partition will be expanded in a separate step. - &prompt.root; gpart resize -i 2 -a 4k -s 47G ada0 + &prompt.root; gpart resize -i 2 -s 47G -a 4k ada0 ada0p2 resized &prompt.root; gpart show ada0 => 34 102399933 ada0 GPT (48G) @@ -293,7 +304,9 @@ 162 98566144 2 freebsd-ufs (47G) 98566306 3833661 - free - (1.8G) - Recreate the swap partition: + Recreate the swap partition and activate it. If no size + is specified with , all remaining space is + used: &prompt.root; gpart add -t freebsd-swap -a 4k ada0 ada0p3 added @@ -307,12 +320,6 @@ Grow the UFS file system to use the new capacity of the resized partition: - - Growing a live UFS file system is only - possible in &os; 10.0-RELEASE and later. For earlier - versions, the file system must not be mounted. - - &prompt.root; growfs /dev/ada0p2 Device is mounted read-write; resizing will result in temporary write suspension for /. It's strongly recommended to make a backup before growing the file system. @@ -320,6 +327,12 @@ super-block backups (for fsck -b #) at: 80781312, 82063552, 83345792, 84628032, 85910272, 87192512, 88474752, 89756992, 91039232, 92321472, 93603712, 94885952, 96168192, 97450432 + + If the file system is ZFS, the resize is + triggered by running the subcommand with + : + + &prompt.root; zpool online -e zroot /dev/ada0p2 Both the partition and the file system on it have now been resized to use the newly-available disk space.