尝试 chroot 到 Arch Linux 时,挂载时出现“权限被拒绝”错误

尝试 chroot 到 Arch Linux 时,挂载时出现“权限被拒绝”错误

我正在尝试按照列出的说明在我的 64 位 Ubuntu 机器上 chroot 到 Arch Linux这里。以下是我目前已采取的步骤:

$ curl -sSLo archlinux.tar.gz http://mirrors.abscission.net/archlinux/iso/2016.03.01/archlinux-bootstrap-2016.03.01-x86_64.tar.gz

$ tar -xvzf archlinux.tar.gz

$ cd root.x86_64

$ sudo bin/arch-chroot .

由于某种原因,我在运行脚本时出现此错误:

mount: permission denied
==> ERROR: failed to setup chroot .
Usage: umount -h | -V
       umount -a [-d] [-f] [-r] [-n] [-v] [-t vfstypes] [-O opts]
       umount [-d] [-f] [-r] [-n] [-v] special | node...

作为参考,这是我cat README在 chroot 中运行时得到的结果:

To install Arch Linux from another distribution, a root server rescue system or 
a live system, follow the instructions at
https://wiki.archlinux.org/index.php/Install_from_Existing_Linux. A short version
is provided below:

* Make sure your system is running Linux 2.6.32 or later.
* Extract this tarball. If you have enough memory, you can extract it into a 
  tmpfs file system. In the example below, we'll assume that you extracted it in
  /tmp.
* Enter the chroot:
  + If you have bash 4 or later installed, run
    # /tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/
  + If you don't have bash 4, run the following commands:
    # cp /etc/resolv.conf /tmp/root.x86_64/etc
    # mount --rbind /proc /tmp/root.x86_64/proc
    # mount --rbind /sys /tmp/root.x86_64/sys
    # mount --rbind /dev /tmp/root.x86_64/dev
    (if /run exists on your system:
      # mount --rbind /run /tmp/root.x86_64/run
    )
    # chroot /tmp/root.x86_64/
* In the chroot
  + Initialize the pacman keyring:
    # pacman-key --init
    # pacman-key --populate archlinux
  + Mount the destination partition under /mnt
* Follow the Arch Linux installation guide
   https://wiki.archlinux.org/index.php/Installation_Guide#Install_the_base_system
  starting at the "Install the base system" step.

如果相关的话,我会在虚拟工作区中运行它云9。也许是无法访问 USB 设备之类的?(如果我听起来好像不知道自己在说什么,请原谅我,我对 chroots/mounting 和诸如此类的东西有点不熟悉。)

任何帮助都将不胜感激,谢谢!

答案1

问题似乎是您没有将任何分区挂载到 /mnt,而是试图将 pacstrap 到安装介质本身。重新检查您是否没有遗漏将分区挂载到 /mnt # mount /dev/sdxY /mnt 然后安装基本软件包,生成 fstab,然后 chroot 到它。

相关内容