9

I have an encrypted APFS container with several volumes. The container lives on a physical partition (disk0s1), which is followed by more partitions (disk0s2, ...) with no free space in between. I need to expand one of the volumes on the container without having to move the other physical partitions in order to expand disk0s1. I know with LVM you can expand the container (physical volume) with other partitions which don't need to be adjacent, or even on the same hard drive. Is that possible with an APFS container?

2 Answers 2

4

There is no official documented way to add another physical storage to an existing APFS container.

I tried several possibly "undocumented" apfsVerbs like addPhysical, addPhysicalStorage or addStorage without success.

The feature may still be implemented later, since creating APFS FusionLCs is possible already:

diskutil ap createContainer [-main] device [-secondary] [device]

Example:

$ diskutil ap createContainer disk1s2 disk2s2    
Creating container with disk1s2 disk2s2
Started APFS operation on disk1s2 Data
Creating a new empty APFS Container
Unmounting Volumes
Switching disk1s2 to APFS
Switching disk2s2 to APFS
Creating APFS Container
FusionLC autodetect: LC Fusion
Created new APFS Container disk4
Disk from APFS operation: disk4
Finished APFS operation on disk1s2 Data

$ diskutil ap addVolume disk4 APFS Data
Exporting new unencrypted APFS Volume "Data" from APFS Container Reference disk4
Started APFS operation on disk4
Preparing to add APFS Volume to APFS Container disk4
Creating APFS Volume
Created new APFS Volume disk4s1
Mounting APFS Volume
Setting volume permissions
Disk from APFS operation: disk4s1
Finished APFS operation on disk4
4
  • 1
    Thanks for that, indeed it's strange that it seems possible to create a new container over two disks (but not more than two?) but not be able to add a disk to an existing container... Dec 21, 2017 at 12:32
  • 2
    @AaylaSecura Apparently only two slices can be used to create a FusionLC - I tried it with three but got an error.
    – klanomath
    Dec 21, 2017 at 12:47
  • This may be a bit late, but I don't think this is an answer to the OPs question. My understanding of fusion disks with APFS is for providing a large, slow hard-drive backing store for all the data and using a smaller, but much faster, SSD for the most commonly used data. The -secondary option above is not adding more storage, but a faster storage cache that stores copies of the most heavily used data.
    – penguin359
    Jan 18, 2021 at 8:30
  • I agree @penguin359 that the intent was to tier storage, however, in practice people are using this very effectively with dual SSD and even with spinning disks - the IO speed isn’t really a problem practically for almost anyone that just wants one big disk to store things…
    – bmike
    Mar 17, 2022 at 13:40
1

In my case 2x 1TB SSD under Big Sur the above answer led to a big problem:

2 SSD's were partitioned in 4 parts:

  • 2x64GB on disk 0 and 1
  • 2x936GB on disk 0 and 1

Following the above guide I:

  • created a 128GB APFS 'system' disk from disk0s2 and disk 1s2 in container disk3

And:

  • created a 1.8TB APFS 'data' disk from disk 0s4 and disk 1s4 using RAID0 that works flawless.

All created APFS (test) volumes in the disk3 container failed on exactly 50% of disk usage (the physical boundary) with a disk full error. This problem does not occur in JHFS+ In all cases Disk Utility states all is OK

The problem occurs in both MacOS 11.6.5 as 12.3 with disk managementd 1934.101.3

4
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
    – Tetsujin
    Mar 17, 2022 at 9:47
  • Not true. It adds that the above given solution by @klanomath (which I used) does NOT always work.
    – Arjan
    Mar 17, 2022 at 10:59
  • It doesn't answer the question, it merely states that you had issues with the existing answer.
    – Tetsujin
    Mar 17, 2022 at 11:03
  • I think the question is open enough to host answers with this level of detail. +1 from me. People also don’t think the accepted answer is an answer so let’s help edit posts with summary or improvements so everyone can learn and share practical experiences.
    – bmike
    Mar 17, 2022 at 13:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .