9 ms·
The author might have had better luck by using an external storage device to boot the Mac and delete unneeded files on the internal disk from there: Use an ext
by miles 3y ago
The author might have had better luck by using an external storage device to boot the Mac and delete unneeded files on the internal disk from there:
Use an external storage device as a Mac startup disk https://support.apple.com/en-us/111336 https://support.apple.com/en-us/111336
Was surprised to learn that with Apple silicon-based Macs, not all ports are equal when it comes to external booting:
If you're using a Mac computer with Apple silicon, your Mac has one or more USB or Thunderbolt ports that have a type USB-C connector. While you're installing macOS on your storage device, it matters which of these ports you use. After installation is complete, you can connect your storage device to any of them.
* Mac laptop computer: Use any USB-C port except the leftmost USB-C port when facing the ports on the left side of the Mac.
* iMac: Use any USB-C port except the rightmost USB-C port when facing the back of the Mac.
* Mac mini: Use any USB-C port except the leftmost USB-C port when facing the back of the Mac.
* Mac Studio: Use any USB-C port except the rightmost USB-C port when facing the back of the Mac.
* Mac Pro with desktop enclosure: Use any USB-C port except the one on the top of the Mac that is farthest from the power button.
* Mac Pro with rack enclosure: Use any USB-C port except the one on the front of the Mac that's closest to the power button.
- userbinator 3y agoIf the filesystem itself got into a deadlocked state, booting from anything and going through the FS driver to delete files from it won't work.
- HumanOstrich 3y agoWhat do you mean by "deadlocked state" for a filesystem?
- pxx 3y agoWhere `rm`, or more technically unlink(2), fails due to ENOSPC, like in the article... Hilariously this failure case doesn't seem to be listed in the docs. https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/unlink.2.html https://developer.apple.com/library/archive/documentation/Sy...
- aidenn0 3y agoSome filesystems may require allocating metadata to delete a file. AFIK it's a non issue with traditional Berkeley-style systems, since metadata and data come from a separate pools. Notably ZFS has this problem.
- em-bee 3y agobtrfs has this problem too it seems. but there it is usually easy to add a usb stick to extend the filesystem and fix the problem. i find it really frustrating though. why not just reserve some space?
- aidenn0 3y agoYeah, with ZFS some will make an unused dataset with a small reservation (say 1G) that you can then shrink to delete files if the disk is full.
- rincebrain 3y agoThis hasn't been a problem you should be able to hit in ZFS in a long time. It reserves a percent of your pool's total space precisely to avoid having 0 actual free space and only allows using space from that amount if the operation is a net gain on free space.
- p_l 3y agoYeah, a situation where you pool gets suspended due to no space and you can't delete files is considered a bug by OpenZFS.
- rincebrain 3y agoI mean, the pool should never have gotten suspended by that, even before OpenZFS was forked; just ENOSPC on rm.
- aidenn0 3y ago
- syncsynchalt 3y agoModern (well, post-ZFS) filesystems operate by moving the filesystem through state changes where data is not (immediately) destroyed, but older versions of the data are still available for various purposes. Similar to an ACID-compliant database, something like a backup or recovery process can still access older snapshots of the filesystem, for various values of "older" that might range from milliseconds to seconds to years. With that in mind, you can see how we get in a scenario where deleting a file will require a minor bit of storage for recordkeeping the old and new states, before it can actually free up the storage by releasing the old state. There is supposed to be an escape hatch for getting yourself out of a situation where there isn't even enough storage for this little bit of record keeping, but either the author didn't know whatever trick is needed or the filesystem code wasn't well-behaved in this area (it's a corner-case that isn't often tested).
- dataflow 3y agoIt feels like insanity that the default configuration of any filesystem intended for laymen can fail to delete a file due to anything other than an I/O error. If you want to keep a snapshot, at least bypass it when disk space runs out? How many customers do the vendors think would prefer the alternative?!
- kamray23 3y agoIt's not really just keeping snapshots that is the issue, usually. It's just normal FS operation, meant to prevent data corruption if any of these actions is interrupted, as well as various space-saving measures. Some FSs link files together when saving mass data so that identical blocks between them are only stored once, which means any of those files can only be fully deleted when all of them are. Some FSs log actions onto disk before and after doing them so that they can be restarted if interrupted. Some FSs do genuinely keep files on disk if they're already referenced in a snapshot even if you delete them – this is one instance where a modal about the issue should probably pop up if disk space is low. And some OSes really really really want to move things to .Trash1000 or something else stupid instead of deleting them.
- p_l 3y ago
- timcederman 3y agoOr boot it into Target Disk Mode using another machine.
- olliej 3y agoyou can't boot the arm Macs into target disk mode, you can only boot to the recovery os and share the drive - it shows up as a network share iirc. I was super annoyed by this a few weeks ago because you can, for example, use spotlight to search for "target disk mode" and it will show up, and looks like it will take you to the reboot in target disk mode option, but once you're there it's just the standard "choose a boot drive" selector.
- klausa 3y agoWhy do you think that would work; if using recoveryOS or starting the Mac Share Disk/Target Disk mode didn't?
- deeth_starr_v 3y agoAnyone know why you can’t use the first usb-c port on a Mac laptop to make the bootable os?
- plussed_reader 3y agoWhat if it's through a USB c adapter to a usbA thumbstick?
- Tsiklon 3y agoThe ports mentioned expose the serial interface that can be used to restore/revive the machine in DFU mode https://support.apple.com/en-us/108900 https://support.apple.com/en-us/108900 That said, no idea why they can’t be used in this case
- joecool1029 3y ago> That said, no idea why they can’t be used in this case My intuitive guess here is how the ports are connected to the T2 security chip. One port is as you said a console port that allows access to perform commands to flash/recover/re-provision the T2 chip. Same as an OOB serial port on networking equip. The rest of the ports the T2 chip has read/write access to devices connected to it. Since this is an OS drive, I'm guessing it needs to be encrypted and the T2 chip handles this function.
- amelius 3y agoThat doesn't make it technically impossible to implement booting from that port.
- p_l 3y agoThe firmware is based on iPhone boot process from my understanding, and simply does not have space in ROM to implement boot from external storage. The rest of the code necessary to boot from external sources is located on main flash
- appplication 3y agoThis is the kind of comment someone is going to be very happy to read in 8 years when they’re looking for answers for their (then) ancient Mac.
- mrb 3y agoThe author tried essentially the same thing as what you suggest. He booted into recoveryOS (a separate partition) then from there tried to delete files from the main system partition. But rm failed with the same error "No space left on device". So as others have suggested, truncating a file might have worked "echo -n >file"
- davorak 3y agoThe next step I have used and seen recommended after recoveryOS is single user mode, which is what I think I used to solve the same issue on an old mac. I vaguely remember another reason I used single user mode where recovery mode failed but I do not remember any details. My bet is that you can get nearly the same functionality with single user mode vs booting from external media, but I only have a vague understanding of the limitations of all three modes from 3-5 uses via tutorials.
- Macha 3y ago> Was surprised to learn that with Apple silicon-based Macs, not all ports are equal when it comes to external booting iirc, not all ports were equal when it came to charging with the m1 macs, so this is actually not so surprising.
- voidbert 3y agoBut charging through many ports requires extra circuitry to support more power on every port, while booting from multiple ports just requires the boot sequence firmware to talk to more than one USB controller (like PC motherboards do, for example)