3

macOS Monterey 修改启动菜单的标签文字

 1 year ago
source link: https://azhuge233.com/macos-monterey-%E4%BF%AE%E6%94%B9%E5%90%AF%E5%8A%A8%E8%8F%9C%E5%8D%95%E7%9A%84%E6%A0%87%E7%AD%BE%E6%96%87%E5%AD%97/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

macOS Monterey 修改启动菜单的标签文字Skip to content

macos-sierra-startup-disk-720x382.png

“启动菜单”是指在 mac 启动时按住 option 键进入的启动选项菜单,“标签文字”是指每个启动项下的文字标签

起因是 Ubuntu 删除 Ext4 分区后把 macOS 分区也搞乱了,重装 Monterey 时格式化将硬盘名称改为了 “未命名”,之后启动项里就一直显示 “未命名”,激起了我的强迫症

使用 macOS 磁盘工具修改硬盘名称无效,网上很多答案使用的 bless 命令也无法更改—— Monterey 使用了 APFS,标签文字文件的位置与之前版本不同而且受到 SIP 保护,无法直接使用 bless 修改

最后在 https://apple.stackexchange.com/questions/436980/rename-macos-monterey-disk-in-startup-manager 找到了答案,以下为步骤

  1. 重启 mac,开机时按住 Command + R 进入恢复模式
  2. 在恢复模式下开启终端,执行
    csrutil disable
    csrutil disable

    关闭 SIP

  3. 重启进入 Monterey,打开终端,执行
    GROUP="$(diskutil info / | grep "APFS Volume Group")"
    UUID="${GROUP##* }"
    # 也可以省略前两行直接 cd 到该目录
    cd /System/Volumes/Preboot/$UUID/System/Library/CoreServices/
    sudo bless --folder . --label "[欲修改的 macOS 启动项标签名称]"
    printf "[欲修改的 macOS 启动项标签名称]" | sudo tee .disk_label.contentDetails; echo
    sudo chgrp wheel .disk*
    GROUP="$(diskutil info / | grep "APFS Volume Group")"
    UUID="${GROUP##* }"
    # 也可以省略前两行直接 cd 到该目录
    cd /System/Volumes/Preboot/$UUID/System/Library/CoreServices/
    sudo bless --folder . --label "[欲修改的 macOS 启动项标签名称]"
    printf "[欲修改的 macOS 启动项标签名称]" | sudo tee .disk_label.contentDetails; echo 
    sudo chgrp wheel .disk*
  4. 之后执行
    sudo csrutil clear
    sudo csrutil clear

    恢复 SIP

  5. 重启 mac 生效

macOS, OS, 所有macOS

发表评论 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

评论 *

显示名称 *

电子邮箱地址 *

网站地址

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK