Introduction:
Several years back a Knowledge Base article on increasing the size of a Pegasus LUN by rebuilding with larger drives was created.
Resently this was restested with macOS Sierra and while the process is the same, something has changed and only 2 terminal commands will resize the Pegasus Volume.
Process:
To save time rebuilds were not done, the LUN size was increased by adding a disk to the array and resizing the LUN to use the additional space.
For everone who wants to increase the size of their macOS Volume, please rebuild one drive at a time. I will leave the process of rebuilding disks to the reader.
The purpose of this KB is to show how to expand the macOS filesystem from Sierra, a 1-disk RAID0 was created and another disk was added to increase the capacity, then the HFS+ filesystem was expanded.
This is the original 1-disk RAID 0, PD2 was added to the RAID and the LUN was grown to use the additional space.
cliib> phydrv
===============================================================================
PdId Model Type Capacity Location OpStatus ConfigStatus
===============================================================================
1 Samsung SSD SATA SSD 499GB Encl1 Slot1 OK Array0 No.0
2 Samsung SSD SATA SSD 499GB Encl1 Slot2 OK Unconfigured
3 Samsung SSD SATA SSD 499GB Encl1 Slot3 OK Unconfigured
4 Samsung SSD SATA SSD 499GB Encl1 Slot4 OK Unconfigured
cliib> logdrv
===============================================================================
LdId Alias OpStatus Capacity Stripe RAID CachePolicy SYNCed
===============================================================================
0 OK 499GB 1MB RAID0 NoCache/WThru Yes
This command was used to add disk 2 to the array and expand the LUN.
cliib> migrate -a start -d 0 -p 2 -l "id=0,raid=0,capacity=998gb"
cliib> logdrv
===============================================================================
LdId Alias OpStatus Capacity Stripe RAID CachePolicy SYNCed
===============================================================================
0 OK 499GB 1MB RAID0 NoCache/WThru Yes
cliib> logdrv
===============================================================================
LdId Alias OpStatus Capacity Stripe RAID CachePolicy SYNCed
===============================================================================
0 OK 998GB 1MB RAID0 RAhead/WBack Yes
The LUN went from 499GB to 998GB after the migration.
macOS still sees a 499GB disk.
The process to expand the filesystem is to first run diskutil repairdisk.
Note that for repairdisk use the disk, disk4 and not the slice.
promise@promises-Mac-mini% sudo diskutil repairdisk disk4
Password:
Repairing the partition map might erase disk4s1, proceed? (y/N) y
Started partition map repair on disk4
Checking prerequisites
Checking the partition list
Adjusting partition map to fit whole disk as required
Did grow entire partition map
Checking for an EFI system partition
Checking the EFI system partition's size
Checking the EFI system partition's file system
Checking the EFI system partition's folder content
Checking all HFS data partition loader spaces
Checking booter partitions
Reviewing boot support loaders
Checking Core Storage Physical Volume partitions
The partition map appears to be OK
Finished partition map repair on disk4
promise@promises-Mac-mini%
The important difference here is that in Sequoia adjusted the GPT partition to see the entire disk. Prior macOS versions did not do this and it required an fsck to fix the filesystem on that partition.
Also note the warning...
Repairing the partition map might erase disk4s1
I have not seen this happen and I expect this is a very rare occurance, but the message is clear, do this at your own risk.
Next step is to resize the HFS+ filesystem.
Note, for this step use the slice, disk4s2.
promise@promises-Mac-mini% sudo diskutil resizevolume disk4s2 R
Resizing to full size (fit to fill)
Started partitioning on disk4s2 (Pegasus M4 499GB)
Verifying the disk
Verifying file system
Volume was successfully unmounted
Performing fsck_hfs -fn -x /dev/rdisk4s2
Executing fsck_hfs (version hfs-683.120.3)
Checking Journaled HFS Plus volume
The volume name is Pegasus M4 499GB
Checking extents overflow file
Checking catalog file
Checking multi-linked files
Checking catalog hierarchy
Checking extended attributes file
Checking volume bitmap
Checking volume information
The volume Pegasus M4 499GB appears to be OK
File system check exit code is 0
Restoring the original state found as mounted
Resizing
Modifying partition map
Growing file system
Finished partitioning on disk4s2 (Pegasus M4 499GB)
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *998.0 GB disk4
1: EFI EFI 209.7 MB disk4s1
2: Apple_HFS Pegasus M4 499GB 997.7 GB disk4s2
promise@promises-Mac-mini%
As you can see, the volume named Pegasus M4 499GB now has a size of 997.7 GB.
2 relatively simple steps and no reboots needed.
The previous KB linked to above goes into more detail about how to find which /dev/disk the Pegasus is, but you can find it with this command. You can identify the Pegasus disk by it's size and the Volume name.
diskutil list