Ich möchte ein Debian stretch installieren, aber ohne Installations-CD
und nicht auf eine Platte sondern in ein Unterverzeichnis. Ich will es
danach mit libvirt und LXC starten. Meine Idee ist es wie bei der Gentoo
Installation ein chroot zu machen und mit apt dann alle Packete zu
installieren (bitte hier nicht über Sinn und Unsinn davon streiten).
Folgendes habe ich bisher gemacht:
1 | root@panther:/vm/tor# mkdir proc sys dev mnt
|
2 | root@panther:/vm/tor# mount -t proc proc proc
|
3 | root@panther:/vm/tor# mount --rbind /sys sys/
|
4 | root@panther:/vm/tor# mount --make-rslave sys/
|
5 | root@panther:/vm/tor# mount --rbind /dev dev/
|
6 | root@panther:/vm/tor# mount --make-rslave dev/
|
7 | root@panther:/vm/tor# mount --rbind / mnt/
|
8 | root@panther:/vm/tor# chroot /vm/tor/ /mnt/bin/bash
|
9 | chroot: failed to run command ‘/mnt/bin/bash’: No such file or directory
|
10 | root@panther:/vm/tor# stat mnt/bin/bash
|
11 | Datei: 'mnt/bin/bash'
|
12 | Größe: 1037440 Blöcke: 2032 EA Block: 4096 reguläre Datei
|
13 | Gerät: 802h/2050d Inode: 4718680 Verknüpfungen: 1
|
14 | Zugriff: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
|
15 | Zugriff : 2016-03-04 21:44:47.388600480 +0100
|
16 | Modifiziert: 2015-12-02 10:34:19.000000000 +0100
|
17 | Geändert : 2016-02-04 21:54:24.696797378 +0100
|
18 | Geburt : -
|
Wie man sieht behauptet 'chroot' das '/mnt/bin/bash' im chroot nicht
Existiert, aber wie man mit stat sieht ist diese eindeutig vorhanden.
Was könnte das sein? Im Anhang ist die Ausgabe von 'strace', 'mount',
'df' und 'ls */' zu finden.
Auch interessant:
1 | root@panther:/vm/tor# chroot /vm/tor/ /mnt/bi
|
2 | chroot: failed to run command ‘/mnt/bi’: No such file or directory
|
3 | root@panther:/vm/tor# chroot /vm/tor/ /mnt/bin/
|
4 | chroot: failed to run command ‘/mnt/bin/’: Permission denied
|
5 | root@panther:/vm/tor#
|
Das zeigt, dass '/mnt/bin/' im chroot vorhanden, und somit '/mnt/' im
chroot gemountet ist.
Warum wird '/mnt/bin/bash' von 'chroot' nicht gefunden, obwohl es da
sein müsste? Wie kann ich das Problem beheben?