0

I have a MacBook Pro (mid 2009, El Capitan) that has two, physical, internal hard drives in it—I removed the built-in dvd drive and replaced it with a second HD.

I've installed Ubuntu 20.04 on the second drive and am able to boot into either system without, as far as I can tell, any problems.

Since I am quite new at using Linux, I'm a little gun-shy about accidentally doing something stupid and screwing up the macOS install on the other HD (yes, I have backups). Is there a way to permanently prevent Ubuntu from even knowing that the second HD exists at all, so that accidents like, "oops, I meant sda1 not sda2!" can't happen. Like a permanent quarantine, you might say.

During the entire installation and configuration process, I physically had the macOS disconnected so that there was no danger but, this is a little inconvenient for booting back and forth not to mention taxing on a 12 year old piece of hardware.

*Yes, I understand that there are never 100% guarantees when an ignorant user, like me, is swimming in dangerous waters but, you know what I mean.

1 Answer 1

2

Yep. Assuming Ubuntu automatically mounts the other drive, the simplest way would be to add a flag to your /etc/fstab file that prevents auto-mounting. You can do this with noauto.

UUID=FEDCBA0987654321Q  /media/macos    apfs    defaults,noauto    0    0

If you're not sure what the partition's UUID is, use blkid:

sudo blkid

This will give you something similar to the following:

/dev/nvme0n1p3: UUID="b72e8406-34e8-4e38-a422-e4ab6e35e6b8" TYPE="swap" PARTUUID="4b9f203e-de2c-4cc0-a9a6-2ac423b1b0e9"
/dev/nvme0n1p2: UUID="b33696cc-f2db-4dd4-9a63-15028cf5afc4" TYPE="ext4" PARTUUID="cd2a90a1-5a6b-4468-a4da-0a2f7c2a8f54"
/dev/nvme0n1p1: UUID="D3F2-9195" TYPE="vfat" PARTUUID="4e505bb1-c12b-4c71-afdf-42ac9a2f721b"
/dev/mmcblk0p1: UUID="dd5dffcf-9e3b-43eb-82a2-36137fc249be" TYPE="crypto_LUKS" PARTUUID="7688e21d-c1d3-4f02-95ac-5e816e2c1e05"

All that being said, if Ubuntu does not automatically mount the other storage device, then you shouldn't need to do anything. You cannot read to or write from the device.

Hope this helps 👍

3
  • 2
    I should point out that this will not block Ubuntu from having access to the drive - the only way to really block that is to unplug the drive/partition.
    – Thomas Ward
    Feb 18, 2021 at 16:22
  • @matigo Thanks for the quick response. Ubuntu doesn't auto mount the drive, so that's good, I guess.
    – tripleman
    Feb 18, 2021 at 17:31
  • @Thomas-ward You are correct: Ubuntu can still see the drive whether it's mounted or not. That means, in my fumbling hands, there is a danger of me messing it up. Just have to be extra careful, I guess.
    – tripleman
    Feb 18, 2021 at 17:31

You must log in to answer this question.

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