- Команда bless: опции, ключи и примеры использования
- base64
- Как установить PostgreSQL на Linux и создать базу и пользователя
- Как скопировать вывод команды из терминала в буфер обмена Linux и MacOS
- Как создать неизменяемый файл в Linux / MacOS / FreeBSD
- Как удалить все Docker образы и контейнеры
- Bash вывода && управляющие конструкции || коротко о главном
- Так ли безопасен Linux? Несколько коммитов с уязвимосятми в stable
- Microsoft открывает исходники, а её IDE супер-популярна
- Пример своей консольной команды в Django проекте
- Как на Bash посчитать число строк в проекте (директории)
- Как на Bash получить файлы, изменённые за сегодняшний день
- Как установить часовой пояс в Linux
- Как найти самые большие папки и файлы в Linux
- Команда grep – полезные ключи и примеры использования
- Question: Q: How to «Bless» system folder
- All replies
- Question: Q: Setboot? Formerly bless? Command line OS switching?
- The Eclectic Light Company
- Question: Q: Can’t use bless/mount EFI partition/use BootChamp
Команда bless: опции, ключи и примеры использования
Set volume bootability and startup disk options.
- MOUNT MODE: set a volume containing either Mac OS 9 and Mac OS X to be the active volume:
- NETBOOT MODE: set the system to NetBoot and broadcast for an available server:
- INFO MODE: gather information about the currently selected volume (as determined by the firmware), suitable for piping to a program capable of parsing Property Lists:
bless —info —plist
base64
Encode and decode using Base64 representation. Encode a file: base64…
Package manager for macOS. Search for available formulas: brew search…
Как установить PostgreSQL на Linux и создать базу и пользователя
PostgreSQL — система управления базой данных общего назначения. Одна из самых распространённых баз данных, используемая на многих коммерческих и некоммерческих проектах.
Как скопировать вывод команды из терминала в буфер обмена Linux и MacOS
Скорее приятный, чем необходимы «трюк», но возможность использовать возможность скопировать вывод в буфер обмена – действительно круто иной раз выручает.
Как создать неизменяемый файл в Linux / MacOS / FreeBSD
Само собой, root может всё (если введёт пару команд), однако, это вполне легальный способ запретить изменение файла.
Как удалить все Docker образы и контейнеры
Не всегда нужно удалять всё, но объяснение данного «рецепта» объяснит как в целом удалять образы и контейнеры.
Bash вывода && управляющие конструкции || коротко о главном
Небольшая заметка о конструкциях Bash, в которых путается большинство новичков. А именно: >,
Так ли безопасен Linux? Несколько коммитов с уязвимосятми в stable
Исследователи сумели пройти code-review с реквестами в ядро Linux, заведомо содержащими добавление уязвимостей.
Microsoft открывает исходники, а её IDE супер-популярна
Решил сложить пару фактов и немного над этим поразмыслить. Реально ли Microsoft «переобулись»?
Пример своей консольной команды в Django проекте
Если вы работали с Django проектом, то, скорее всего, запускали команды из консоли (manage.py). В Django есть простой способ писать свои команды для управления проектом.
Как на Bash посчитать число строк в проекте (директории)
Ниже будет представлен однострочник, решающий данную задачу на Bash + пошаговое описание его работы.
Как на Bash получить файлы, изменённые за сегодняшний день
Bash имеет огромные возможности по программированию/скриптованию и администрированию операционной системы. Не важно: Linux это, FreeBSD, или MacOS – на Bash можно сделать многое.
Как установить часовой пояс в Linux
В рамках первичной настройки Операционной Системы важно установить и по какому времени вы живёте, ведь при следующем обновлении времени через Интернет ваше время слетит.
Как найти самые большие папки и файлы в Linux
Когда кончается место на жестком диске, возникает закономерный вопрос: на что же оно было потрачено, какие файлы разрослись больше положенного?
Команда grep – полезные ключи и примеры использования
У команды «grep» довольно много различных особенностей. особенно, если учесть, что с английского это «решето» – а что может войти в решето , не факт что выйдет!
Источник
Question: Q: How to «Bless» system folder
Ok, on occasion (3rd time) when I have to reboot for any reason, the computer hangs on the opening screen with the apple on it. Then nothing happens, so I have to reboot using my backup (but smaller) HD. Now, the system folder of the working drive, sees that the non working drive has OS X installed and lets me select it to «startup» but now I get the folder with question mark.
So, before I had to erase and install new. I don’t want to do that. Archive and install does not work. I think that the computer just can’t find the system folder and goes to my backup HD. i did some digging and think I need to re-bless the bad system folder. But cannot find the right info step by step to do so.
Anyone know how.
Thanks.
DA 667, Mac OS X (10.4.3)
Posted on Feb 7, 2006 9:50 PM
All replies
Loading page content
Page content loaded
There is no such thing as «blessing» a system folder in OS X. That was something done in Mac OS. Your problem suggests that one or more of the operating system files needed during startup is corrupted either because the files are corrupted or there’s a problem with the directory or the hard drive.
What you can try is to repair the hard drive. However, that will not repair damaged files, only a damaged directory. So there is no assurance it will fix the problem. You say you cannot Archive and Install, but you don’t say why.
To repair the drive do the following:
Boot from your OS X Installer. Be sure to use the installer for the version of OS X you have installed. After the installer loads select Disk Utility from the Installer menu (or Utilities menu if using Tiger.) After DU loads select your OS X volume from the list on the left, click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now shutdown the computer for a couple of minutes and then restart normally.
If DU reports errors it cannot fix, then you will need Disk Warrior (3.0.3 for Tiger) and/or TechTool Pro (4.1.1 for Tiger) to repair the drive. If you don’t have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
If this doesn’t repair the problem, then either you do an Erase and Install or an Archive and Install. The latter would be preferable if you didn’t want to erase the drive. However, unless the drive has been verified as OK an Archive and Install will likely fail.
Источник
Question: Q: Setboot? Formerly bless? Command line OS switching?
I run a couple of computer labs at a university that dual boot into Mac OSX 10.11.6 and Windows 8.1 Pro. Years ago, I used to be able to run a bless -setboot command from Apple Remote Desktop to start up an entire classroom on one platform or the other, both on a schedule and on demand.
We used to us commands like this on the Mac side: bless -mount /Volumes/ -setBoot shutdown -r now
And then we were able to script the Windows side with stuff like this: C:\Program Files\Boot Camp\bootcamp.exe» -StartupDisk «Macintosh HD»
However, this stopped working sometime around Mavericks, because the name of the boot volume seemed to randomly be either EFI Boot or Macintosh HD.
I’ve been researching this a lot, and came across how «bless» is depreciated and I should use systemsetup after disabling csrutil. (You can’t even -liststartupdisks without disabling csrutil!)
So if I run this: sudo systemsetup -liststartupdisks
However, doing this doesn’t work: sudo systemsetup -setstartupdisk /Volumes/.BOOTCAMP/WINDOWS
It returns: Not a System Folder: /Volumes/.BOOTCAMP/WINDOWS/System/Library/CoreServices
I AM able to boot into Windows 8.1 Pro and Mac OS 10.11.6 by holding down option and restarting. and also the Recovery partition (why isn’t that listed?)
I’m thinking about buying something like Boot Runner, but it doesn’t have the sort of command line control via ARD and VNC that I’d like to have. Has anyone found a Setboot workaround for El Capitan?
Источник
The Eclectic Light Company
The last piece in the puzzle that is the booting of a Mac is understanding how any given volume is made bootable, and how it can be made the next startup volume.
This used to be simple, before the advent of SIP, APFS, and Secure Boot in the T2, and came down to a single very complex command bless . That could:
- write the information to the volume header which declared that volume as being bootable;
- set the two NVRAM variables efi-boot-device and efi-boot-device-data to make any bootable volume the next startup disk;
- prepare a volume so that it could be made bootable, by copying boot.efi to the right place;
- configure the Mac to boot not from a local volume but from a server, using NetBoot;
and more. You can see why bless is complex to use.
Now, the only use of bless which you should be happy with, unless you really know what you’re doing, is
bless —info
which returns information about the current boot settings, such as
finderinfo[0]: 325985023 => Blessed System Folder is /System/Library/CoreServices
finderinfo[1]: 342576416 => Blessed System File is /System/Library/CoreServices/boot.efi
finderinfo[2]: 0 => Open-folder linked list empty
finderinfo[3]: 0 => No alternate OS blessed file/folder
finderinfo[4]: 0 => Unused field unset
finderinfo[5]: 325985023 => OS X blessed folder is /System/Library/CoreServices
64-bit VSDB volume id: 0x[omitted]
The numbers given for each of the lines in the boot settings are the file system inode numbers, which are more persistent than the conventional paths which they resolve to. macOS here uses inode numbers instead of paths; you can use my free utility Precize to explore inodes and their relatives.
Try this command on a Mac booted from an APFS volume, and you’ll be disappointed: you either have to run it with privileges as
sudo bless —info
or after mounting the preboot volume, which rather defeats its purpose, perhaps. You’ll then be given the inodes and paths to the Blessed System File and Folder on that preboot volume, and the Blessed Volume for the container should be given as the root path, /.
If you use any of its other options, there is always the risk that you will render that Mac unbootable (at least temporarily), so you should be extremely cautious.
Making a volume bootable is a task which the user very seldom has to do. When you install macOS on a volume, the installer should do that for you as part of the service. If you use a tool such as Carbon Copy Cloner or SuperDuper to clone an existing bootable volume, one of its options should be to make that cloned disk bootable by blessing it. Only if that fails, or if you are trying to perform this task by hand, should you ever need to use the bless command in anger. When you do, study its man page very carefully and make sure that you get the command right.
The first blow to bless came in macOS 10.11: one of the side-effects of SIP is that it shouldn’t be used to try to set the startup disk. Its replacement is systemsetup -setstartupdisk if you need to do this at the command line. Only that doesn’t work in T-2 equipped iMac Pro models, which apparently require you to enter Recovery mode and disable SIP before you can use the command. Secure Boot is another issue which can limit what you can do with bless , an issue which is still being explored, as far as I can tell.
Additionally, bless is currently suffering from a bug which makes it incompatible with APFS containers on Apple RAID arrays: it is unable to find the Preboot volume in that case, and cannot set the container up as being blessed.
Before you try blessing any volume, you should ensure that it has what it takes to be a boot volume too. Normally, on a non-T2 Mac booting from an HFS+ disk, it needs a boot loader at /System/Library/CoreServices/boot.efi. A helper partition is normally used when a disk is encrypted using HFS+ FileVault 2, or the storage device requires additional drivers, such as an external RAID array.
On a non-T2 Mac booting from an APFS disk, the boot loader should be in the path [UUID]/System/Library/CoreServices/boot.efi on the special Preboot volume /dev/disk1s2.
One final requirement which is sometimes forgotten, but which can stop any of this from happening, is that the hardware – the Mac’s interface and the drive enclosure (for external disks) – must support booting that Mac. Some drive cases offer connections such as USB 3 or Thunderbolt which cannot be used to boot through, even though many other external drives use the same connection very successfully. This affected some who tried to install early betas of macOS Mojave on external drives, for example, although in most cases the installation failed. Changing the interface used and the connection can often work around these quirks.
Источник
Question: Q: Can’t use bless/mount EFI partition/use BootChamp
After the new macOS 10.13.6 update, my ability to use BootChamp to quickly switch to Windows 10 from macOS via one-time next only boot is gone. After further investigation, I also found I was unable to mount the EFI partition via «diskutil mount disk0s1». I need the ability to use BootChamp back.
What I’ve already tried:
— Resetting PRAM and NVRAM via command+option+p+r after boot chime
— Resetting SMC via shut down, and then holding control+option+shift+power button for 10 seconds, and then booting up
— Disabling system integrity protection via recovery mode terminal after resetting SMC/NVRAM (SIP was also off before resetting those 2)
— Running the command «sudo /usr/sbin/bless —mount /Volumes/BOOTCAMP/ —setBoot —nextonly —verbose» as a suggestion from this link: https://github.com/kainjow/BootChamp/issues/8.The output from terminal I get is this: https://ghostbin.com/paste/67hrc
— Running «/sbin/fsck -fy» from single-user mode
I have not tried First Aid in disk utility or re-installing the BootChamp app yet.
Running » mkdir /Volumes/efi » and then » sudo mount -t msdos /dev/disk0s1 /Volumes/efi » both as root now allows me to mount the EFI partition normally via «diskutil mount disk0s1», but does not fix BootChamp.
FYI holding option at boot does allow me to go to windows. Here is my output for «diskutil list»: https://ghostbin.com/paste/amf9z
I am using a 13″ 2015 MacBook Pro with Retina display on macOS High Sierra 10.13.6
MacBook Pro with Retina display, macOS High Sierra (10.13.6), Early 2015 model
Источник