Freedom and Privacy, Technology, Tutorial, Ubuntu

How to Deal with Apple hfs+ Files and Hard Drives on Ubuntu

Short version of the story is that I ended up with a drive from some guy who uses Crapple stuff. It was a hard drive with business stuff on it, unencrypted (I can’t believe I thought he would have cared about protecting the company data‚Ķ). My plan was to simply move the contents to a temporary drive, set up LUKS encryption like I always do on the drive (format it) and then move the files back on the original drive. During the process, I found out that apple has (apparently) their own kind of disk type called ‘hfs+’. When I tried to move files, delete files, or do anything useful (Including open many of them) I was greeted with a permission problem. Super annoying.

This blog is to simply show how I finally got stuff working in my normal Ubuntu environment so hopefully this will help.

Chowning your way to Victory

I found that for each step of the journey, the following command is your friend:

sudo chown -R $USER:$USER /path/to/drive

In order to run this command on your drive or folder, you’ll have to find it. For directories on your main hard drive, it should be easy, however based on how easy it is to enter a wrong command, I would recommend always running these commands on an external drive so you don’t mess up your main drive and permissions. If this isn’t possible for whatever reason, just be super careful you are targeting the right path! I have warned…

If you are targeting files on an external drive, probably it will be found in your /media/ubuntuUser/ directory where ‘ubuntuUser’ is the username that you log into your machine with. Let’s say my drive is called 1TB_TOSHIBA in that folder and that inside that drive is my apple folder with apple permission stuff on it called /crapple.

I would run this command:

sudo chown -R $USER:$USER /media/ubuntuUser/1TB_TOSHIBA/crapple

After it’s done doing it’s thing you ‘should’ be able to use everything inside it ‘like normal’. At this point you can copy the files around and move them where they need to be. In this case I now did my usual copy of files from Nautilus over to the newly encrypted drive.

However, once copied over I found I had to do the command once more on this directory on the new drive, too. Not sure why but probably a failed command on my part. Hopefully you won’t have to, but if you do, it’s the same command but different drive perhaps such as:

sudo chown -R $USER:$USER /media/ubuntuUser/2TB_WESTERN_DIGITAL/crapple

It seems (and sadly I’m not qualified enough to confirm this) that by running this command before you do any actions, it creates the new permissions and then they seem to ‘stick’ with the files after you do actions to them such as move them to another hard drive.

I hope this helped some or all of you and have a great day.

Tagged , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *