Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // a quick run-thrgouh of creating two space-sharing volumes on one apfs container
- // save me a lot of typing
- $ alias apfs="diskutil apfs -IHaveBeenWarnedThatAPFSIsPreReleaseAndThatIMayLoseData"
- // create an apfs image
- $ hdiutil create -fs APFS -size 20GB apfs.sparseimage
- WARNING: You are using a pre-release version of the Apple File System called
- APFS which is meant for evaluation and development purposes only. Files
- stored on this volume may not be accessible in future releases of OS X.
- You should back up all of your data before using APFS and regularly back up
- data while using APFS, including before upgrading to future releases of OS X.
- Continue? [y/N] y
- created: /Users/soneil/Desktop/apfs.sparseimage
- // and attach
- $ hdiutil attach apfs.sparseimage
- /dev/disk3 GUID_partition_scheme
- /dev/disk3s1 EFI
- /dev/disk3s2 Apple_APFS
- /dev/disk3s2s1 41504653-0000-11AA-AA11-0030654 /Volumes/untitled
- // note s2s1; disk3s2 is the container, s2s1 is the volume
- // unmount the volume, but leaving the container attached (not ejected)
- $ hdiutil unmount /Volumes/untitled
- "/Volumes/untitled" unmounted successfully.
- $ diskutil list /dev/disk3
- /dev/disk3 (disk image):
- #: TYPE NAME SIZE IDENTIFIER
- 0: GUID_partition_scheme +21.5 GB disk3
- 1: EFI EFI 209.7 MB disk3s1
- 2: Apple_APFS 21.3 GB disk3s2
- /dev/disk3s2s1 (external, virtual):
- #: TYPE NAME SIZE IDENTIFIER
- 0: APFS Volume untitled +20.5 KB disk3s2s1
- // add a new volume to the container
- $ apfs addVolume disk3s2 APFS SecondVolume
- Exporting new shared unencrypted APFS Volume "SecondVolume" from APFS Container Reference disk3s2
- Started APFS operation
- Adding APFS Volume to APFS Container
- Creating APFS Volume
- Created new APFS Volume disk3s2s2
- Mounting APFS Volume
- Finished APFS operation
- // reattach the original volume
- $ hdiutil mount /dev/disk3s2s1
- /dev/disk3s2s1 41504653-0000-11AA-AA11-0030654 /Volumes/untitled
- // and admire the result
- $ apfs list
- ======================================================================================================
- ENUMERATION OF ALL CURRENT APFS OBJECTS
- APFS CONTAINER: REFERENCE: disk3s2 Total Container Size = 21.3 GB (21265080320 Bytes)
- | Container Free Space = 21.2 GB (21203574784 Bytes)
- |
- |--< APFS PHYSICAL STORE: disk3s2
- |
- |--> APFS VOLUME: disk3s2s1 Volume Name = untitled (/Volumes/untitled)
- | Space-Sharing Current Volume Size = 24.6 KB (24576 Bytes)
- |
- |--> APFS VOLUME: disk3s2s2 Volume Name = SecondVolume (/Volumes/SecondVolume)
- | Space-Sharing Current Volume Size = 24.6 KB (24576 Bytes)
- |
- ======================================================================================================
- ---------------------------------------------------------------------
- APFS OBJECTS BY ITERATING ALL CURRENT DISKS WHILE CHECKING APFS ROLES
- APFS PHYSICAL STORE = disk3s2 -> APFS CONTAINER REFERENCE = disk3s2
- APFS VOLUME = disk3s2s1 -> APFS CONTAINER REFERENCE = disk3s2
- APFS VOLUME = disk3s2s2 -> APFS CONTAINER REFERENCE = disk3s2
- ---------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement