AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-107973

Peter's questions

Martin Hope
Peter
Asked: 2013-09-19 05:29:19 +0800 CST

为键盘配置设置 debconf 选择失败...布局最终为阿富汗尼

  • 6

我有一台我安装的机器,设置了德语键盘,但它忽略了我的设置,并且安装了美式键盘。我确定我设置了它,因为如果我不设置它,它会以交互方式询问,但我想要一个无人值守的安装。

这是 Ubuntu 12.04.3

所以现在之后,我想编写一个修复脚本以使其成为德语键盘。

因此,首先我在一台机器上以交互方式设置设置,然后读取设置以查看它们的值,然后在另一台机器上,我设置选择:

debconf-set-selections <<< "keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/compose select No compose key"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean false"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/layoutcode string de"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/layout select German"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/modelcode string pc105"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/optionscode string "
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/switch select No temporary switch"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/toggle select No toggling"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/unsupported_config_layout boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/unsupported_config_options boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/unsupported_layout boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/unsupported_options boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/variantcode string "
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/variant select German"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/xkb-keymap select "

然后我显示选择:

debconf-show keyboard-configuration

这是输出:

* keyboard-configuration/modelcode: pc105
* keyboard-configuration/unsupported_config_options: true
* keyboard-configuration/unsupported_config_layout: true
* keyboard-configuration/toggle: No toggling
* keyboard-configuration/compose: No compose key
* keyboard-configuration/layout: German
* keyboard-configuration/xkb-keymap:
* keyboard-configuration/variant: German
  debian-installer/console-setup-udeb/title:
* keyboard-configuration/switch: No temporary switch
* keyboard-configuration/unsupported_options: true
  console-setup/detect:
  console-setup/detected:
* keyboard-configuration/altgr: The default for the keyboard layout
* keyboard-configuration/ctrl_alt_bksp: false
* keyboard-configuration/unsupported_layout: true
* keyboard-configuration/variantcode:
* keyboard-configuration/model: Generic 105-key (Intl) PC
* console-setup/ask_detect: false
* keyboard-configuration/layoutcode: de
  keyboard-configuration/other:
* keyboard-configuration/store_defaults_in_debconf_db: true
* keyboard-configuration/optionscode:

然后重新配置包以使系统实际使用设置,我运行:

DEBIAN_FRONTEND=noninteractive dpkg-reconfigure keyboard-configuration

这是输出:

update-initramfs: deferring update (trigger activated)

然后检查发生了什么,我再次检查设置:

debconf-show keyboard-configuration

这是输出:

* keyboard-configuration/modelcode: a4techKB21
  keyboard-configuration/unsupported_config_options: true
  keyboard-configuration/unsupported_config_layout: true
* keyboard-configuration/toggle: Caps Lock
* keyboard-configuration/compose: No compose key
* keyboard-configuration/layout: Afghani
* keyboard-configuration/xkb-keymap: af
* keyboard-configuration/variant: Afghani
  debian-installer/console-setup-udeb/title:
* keyboard-configuration/switch: No temporary switch
  keyboard-configuration/unsupported_options: true
  console-setup/detect:
  console-setup/detected:
* keyboard-configuration/altgr: The default for the keyboard layout
* keyboard-configuration/ctrl_alt_bksp: false
  keyboard-configuration/unsupported_layout: true
* keyboard-configuration/variantcode: ,
* keyboard-configuration/model: A4Tech KB-21
* console-setup/ask_detect: false
* keyboard-configuration/layoutcode: us,af
  keyboard-configuration/other:
* keyboard-configuration/store_defaults_in_debconf_db: true
* keyboard-configuration/optionscode: grp:caps_toggle,grp_led:scroll

为什么哦,为什么将其变成阿富汗语布局(在每个问题的字母列表中首先选择)?为什么它不能只使用我的设置,或者至少忽略它们,而不是用虚假值设置它们!

而在过去,我使用了更像这样的东西,但使用了其他东西(如后缀等):

apt-get install --reinstall keyboard-configuration

但在这种情况下,使用键盘配置,它的作用与

DEBIAN_FRONTEND=noninteractive dpkg-reconfigure.

我还将交互式设置机器与重新配置之前使用上述脚本编写的机器进行了比较,整个机器的 debconf 是相同的,除了“grub-pc grub-pc/install_devices ...”有一个 id,显然不是相关的。如果我在交互式安装的机器上运行脚本化方法,它不会重置为阿富汗尼,因此尽管 debconf 相同,但系统的行为会有所不同。

有针对这个的解决方法吗?

我已经看过了:

“dpkg-reconfigure 键盘配置”实际上是做什么的? http://ubuntuforums.org/showthread.php?t=1793250 自动化 dpkg-reconfigure tzdata

ubuntu-12.04
  • 5 个回答
  • 8843 Views
Martin Hope
Peter
Asked: 2012-05-10 01:51:51 +0800 CST

奇怪的 mdadm 行为 - 创建失败时,md127 在新创建的部分清零分区上出现“设备或资源繁忙”

  • 0

问题:

# ls /dev/md*
/dev/md0  /dev/md1

# dd if=/dev/zero of=/dev/sdb3 bs=1M count=1
# dd if=/dev/zero of=/dev/sdd3 bs=1M count=1
# mdadm --zero-superblock /dev/sdb3
# mdadm --zero-superblock /dev/sdd3

# mdadm --create -l 1 -n 2 /dev/md2 /dev/sdb3 /dev/sdd3
mdadm: cannot open /dev/sdb3: Device or resource busy

# ls /dev/md*
/dev/md0  /dev/md1  /dev/md127  /dev/md2

# mdadm -D /dev/md127
mdadm: md device /dev/md127 does not appear to be active.

我没有要求它自动检测和组装任何东西。我也没有重启。

我在这些磁盘上多次移动分区以尝试不同的设置。所以很可能到处都有那些实验的痕迹。

sdb3 不忙。我刚刚像这样在几秒钟前创建了它:

swapoff -a
parted /dev/sdb rm 4        (my old raid10 + lvm)
parted /dev/sdb rm 3        (my old swap)
parted /dev/sdd unit s mkpart root4 503808 5860533118 (start here is same as swap start, and end is same as raid10+lvm end)
parted /dev/sdd set 3 raid on

另外,如果我创建了一个只有 /dev/sdd3 的设备,--create 命令也会打印:

mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md2 started.

但它现在也打印出来,在“-l 1”再次工作之后,没有“设备或资源繁忙”消息。(并且该磁盘有一个 bios_grub 和引导 raid1 分区,其元数据为 0.90,但此 sdd3 与引导无关)。

虽然我现在无法重现这个...我尝试了几次并很好地重现了它,但是在尝试使用“-l 0”之后,它起作用了。“-l 10”与“-l 1”具有相同的效果。

问题:

为什么会出现md127?

如果创建失败,为什么还要使用 md2?

将来,除了使用:

  • dd 将块设备的开始归零
  • mdadm --zero-超级块
  • 并使用“-l 0”创建(这是一个无意义的解决方案)

我还能做些什么来清理磁盘以为“--create”做准备?

linux mdadm
  • 2 个回答
  • 3665 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve