Can I have both a case-insensitive system volume and a case-sensitive volume within an encrypted CoreStorage volume?
Core Storage:
- can not create a volume within a volume
- can create a logical volume (LV) within a logical volume group (LVG).
… to keep the main system volume case-insensitive …
That's reasonable.
… to have my home dir be case-sensitive …
Maybe desirable, but please beware: some software for OS X may not work as expected in that environment. I thought first of Adobe, found examples from 2012 and 2013:
An example – OS X 10.9.5, Mavericks
I used Disk Utility to create two partitions from a USB flash drive (at /dev/disk12
at the time), then erased each of the unencrypted file systems – and opted to encrypt.
For both encryptions I chose the same passphrase that is used to encrypt the FileVault 2 OS X startup volume.
The relevant part of output from diskutil coreStorage list
:
+-- Logical Volume Group 391198AA-F179-466A-BD30-1B9BF02D9CAF
| =========================================================
| Name: journaled, encrypted
| Status: Online
| Size: 2004877312 B (2.0 GB)
| Free Space: 0 B (0 B)
| |
| +-< Physical Volume 0A2101EC-811E-4E12-9CFD-A3CAEE4299D9
| | ----------------------------------------------------
| | Index: 0
| | Disk: disk12s2
| | Status: Online
| | Size: 2004877312 B (2.0 GB)
| |
| +-> Logical Volume Family 83E9BA42-4F8D-4AF4-BBEA-F831A4C5E1F5
| ----------------------------------------------------------
| Encryption Status: Unlocked
| Encryption Type: AES-XTS
| Conversion Status: Complete
| Conversion Direction: -none-
| Has Encrypted Extents: Yes
| Fully Secure: Yes
| Passphrase Required: Yes
| |
| +-> Logical Volume C098FD1F-49E4-48D7-A3ED-1F8AC38FCA14
| ---------------------------------------------------
| Disk: disk13
| Status: Online
| Size (Total): 1669324800 B (1.7 GB)
| Conversion Progress: -none-
| Revertible: No
| LV Name: journaled, encrypted
| Volume Name: journaled, encrypted
| Content Hint: Apple_HFS
|
+-- Logical Volume Group CA81191D-B39E-4B19-B4B6-FEC1FF3D2478
=========================================================
Name: case-sensitive, journaled, encrypted
Status: Online
Size: 1526685696 B (1.5 GB)
Free Space: 0 B (0 B)
|
+-< Physical Volume 4DDC2838-F234-430B-89E5-0C0AF59ECC28
| ----------------------------------------------------
| Index: 0
| Disk: disk12s3
| Status: Online
| Size: 1526685696 B (1.5 GB)
|
+-> Logical Volume Family FA8E36E2-724C-44B6-BC74-C7310BAE26D6
----------------------------------------------------------
Encryption Status: Unlocked
Encryption Type: AES-XTS
Conversion Status: Complete
Conversion Direction: -none-
Has Encrypted Extents: Yes
Fully Secure: Yes
Passphrase Required: Yes
|
+-> Logical Volume A4C96B6E-06F4-4E49-B57F-AA5DDC05EF66
---------------------------------------------------
Disk: disk14
Status: Online
Size (Total): 1191133184 B (1.2 GB)
Conversion Progress: -none-
Revertible: No
LV Name: case-sensitive, journaled, encrypted
Volume Name: case-sensitive, journaled, encrypted
Content Hint: Apple_HFSX
Limitations
I rebooted the Mac to check whether either logical volume family (LVF) was automatically unlocked before loginwindow is launched by launchd. As expected, no automation of that sort.
Issues
With Mavericks I can find no way to create more than one LV within an LVF.
The following articles state that it's possible to do so:
In the Franke article it's remarkable that the same UUID is used to both (a) shrink an existing LV; and (b) create another LV in the same LVF.
Unless I'm missing something, this approach is impossible with Mavericks. For example:
sh-3.2$ diskutil coreStorage resizeVolume DAED4621-90CF-43D1-BC40-F7ACABD7174F 600G
The Core Storage Logical Volume UUID is DAED4621-90CF-43D1-BC40-F7ACABD7174F
Started CoreStorage operation
Checking file system
Checking Journaled HFS Plus volume
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 Yosemite appears to be OK
Shrinking file system
Shrinking Logical Volume
Resizing Core Storage Logical Volume structures
Resized Core Storage Logical Volume to 600000000000 bytes
Finished CoreStorage operation
sh-3.2$ diskutil coreStorage createVolume DAED4621-90CF-43D1-BC40-F7ACABD7174F jhfsx case-sensitive 65G
DAED4621-90CF-43D1-BC40-F7ACABD7174F does not appear to be a valid Core Storage Logical Volume Group UUID or name
sh-3.2$ diskutil cs list | grep DAED4621-90CF-43D1-BC40-F7ACABD7174F
+-> Logical Volume DAED4621-90CF-43D1-BC40-F7ACABD7174F
Assuming a bug in Core Storage in Mavericks
We should review this answer – maybe add another – after Yosemite is released.
(I should not expect a fix in Mavericks.)
I've run in to this before and the only solution I'm aware of is to reformat your file system. Here's what I suggest you do:
Boot off of your OSX install media and use Disk Utility to clone your OS image on to another drive.
Reformat your main drive with the file system you want
Restore the contents of your backed-up system to the main drive.
You could also go largely through Time Machine for this, but I'd recommend going straight at Disk Utility. TimeMachine refuses to restore from backups that have a different case-sensitivity setting.
Here's a random link to someone's article on cloning a drive with Disk Utility.
Best Answer
I had a similar issue and this is how I went.
Warning this involves a total reinstallation of your OS, wiping and partitioning your drives. With an SSD, it might be possible to push files into a new partition and by doing this repeatedly, squeeze your data into 3 partitions and then down to the desired two without wiping anything (maybe), but with billions of read/writes going over and over the same cells, such a method has the potential to noticeably age your SSD max life cycles. Backup, Partition and Restore has a much better outcome
My set up: iMac late 2012: macOs 10.14, 1TB HD, 1TB Time Machine, 0.6TB external HD, and about 45 GB synced in 315 GB in GDrive space.
All my personal documents are live synced to gdrive and also backed up to Time Machine. Some of my lesser projects are also synced to gdrive and also backed up to Time Machine. I would strongly recommend you use multiple backup strategies for your most critical documents. I only have a few files in my home directory, rather I have everything linked from the cloud in the Documents, Pictures, Music &etc directories. All my big projects, archives, and video editing I keep in …/Shared as they are way too large to sync to the cloud.
Having said that, I followed the recommendations from Apple and other reliable gurus and accepted that APFS case sensitive is not recommend for applications. So I prepared to split my hard drive 100 GB for macOS ( / ) APFS regular and 900GB APFS case sensitive for /Volumes/Users.
I was going to relocate my home directory and the Shared directory from /Users to /Volumes/Users/……
Determine how much you are going to need for your macOS drive, which mounts at /. First determine how much you have in /Users and the subtract that amount from the total usage on your 1TB. On my iMac, for 110+ apps all the libraries and system files and other normally hidden folders it was about 60GB total, so a 40% margin for growth was fine. Your situation may be different.
On my 0.6TB external drive I have kept a repository of all the dmg, zip, tar, and pkg files that installed programs on my Mac. I have also kept a text file list of all the application in my /Applications and under /usr/local/Cellar & …Caskroom to aid in reinstallations where needed.
Now with a full Time Machine backup of the entire SSD and extra backups, installation files, and lists, you are ready for a smooth transition. And you are covered pretty much if everything goes south too.
With an active internet connection, do the reboot Cmd-Opt-R iNet recover. Do a new install and partition the SSD as desired, first partition APFS regular 10-20% of space (as you have pre-determined will be needed with growth room included) Make a second partition using all the remaining space (less if you have a plan for a 3rd partition for special use) using APFS case sensitive and name it "Users". I would choose that name so as to reduce some possible confusion for certain programs looking for a relative path, but you could call it Data, if you wanted. Continue with the installation and set the first partition (I named mine "macOS") as the install destination drive.
When installing use the same username/password for yourself, this will greatly simplify your efforts.
After installation and rebooting login as yourself and then, if you don't know how to set up root as a user and login as root, create second user, anyname, as administrator and log in as them. COPY the nearly empty new folders from /Users over to the new volume, /Volumes/Users. Choose copy over move because in a worst case loss of your Data volume, you can still boot in as you with your permission intact. (Hint: once in awhile you might want to copy your hidden user setting file over to /Users/yourname—I use midnight-commander to do that. By using a second administrator, all of the files will be free to copy the can be copied. Your admin identity is now safely in two locations. You can logout and back in as yourself.
You are now ready to move your home folder assignment. In the System Preferences/Users & Groups, unlock the settings first. Remove the second admin you created and all their files & directories. Now right-click on your ID in the left-hand table and choose advanced options. It is here you can "move" your home directory to the new one on the second, case sensitive partition, /Volumes/Users/yourname.
Once you have changed your home directory, you can reboot and and log in. /Users/yourname and …/Shared are now orphaned.
Here is where you have to choose, speed OR security and reliability: Note you can not just restore as that will try to put everything back on the now much smaller first partition.
A. the faster method:
This method holds the probable risk that your moved identity will not recognize most of the restored programs/have the right settings for them, and if you then go on to restore yourname from the Time Machine in the same way, you also won't have the right settings restored.
B. the surer (slower) method
Next, you should re-install all your previous programs. Once done, you should re–establish your email settings and other on-line accounts through System Preferences. If you archive your emails, like I do, you can't just restore them because the directories are no longer have the same names. However, you can import them through Mail out of Time Machine under your old file structure, ~/Library/Mail/ into your "new" email. Once they are imported you can rearrange them as you like.
Important: do not re-establish your Time Machine drive as the current backup drive before you are satisfied that everything has migrated correctly, or the app will start dumping older files to make room for the "new" ones without ask you.
Next, you can start restoring all your Document, pictures and such, and if you have used …/Shared to file all your project data, and however you have used it, those folders can all be dragged out of Time Machine and copied back to their original location. I recommend this way as it will make sure that all of your permissions remain as before.
When finish, your OS should be on a APFS case-insensitive boot partition and all your user identity and all your data should be on a APFS case-sensitive data partition.
You can go back into the Time Machine if you find some settings just won't work and look for the originals.
If all else fails, you can rewind it all back by restoring (with re-partitioning) from your original Time Machine backup.
I was up and running in about 4 hours but I have a LOT of customizations and it was three more days before I was happy.
Be patient and methodical and this should work well for you.
Richard