Son 2 gündür önyüklenebilir bir debian (jessie / 8.4) görüntüsü oluşturmaya çalışıyorum ve prosedürün doğru olduğunu söyleyebildiğim kadarıyla dosya sistemini doğru alamıyorum. Ben nispeten emin ben burada bir şey yanlış yapıyor montaj ile bir şeyler eksik veya olduğumu duyuyorum /etc/fstab( benim görüntüde bir tane değil ). Biraz tecrübesi olan birisinin bana yardım edebileceğini / eksik olduğumu gösterebileceğini umuyordum.
İşte qemu-system-x86 içine önyükleme yaptığımda gördüğüm hatalar:
Metin olarak ve ardından gerçek ekran görüntüleri olarak:
Hatalar:
fsck: error 2 (No such file or directory) while executing fsck.ext2 for /dev/sda1
fsck exited with status code 8
[FAILED] Failed to start Load/Save Random Seed
See `systemctl status systemd-random-seed.service` for details.
[FAILED] Failed to start Various fixups to make systemd work better on Debian.
See `systemctl status debian-fixup.service` for details.
...
[FAILED] Failed to start Update UTMP about System Boot/Shutdown.
See `systemctl status systemd-update-utmp.service` for details.
[DEPEND] Dependency failed for Update UTMP about System Runlevel Changes.
İşte kendim için yazdığım talimatlar / attığım adımlar:
cd ~
mkdir debootstrap
cd debootstrap/
# get newest
wget http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.80_all.deb
ar -x debootstrap_1.0.80_all.deb
zcat /root/debootstrap/data.tar.gz | tar xv
apt-get install parted
# 1.5Gbytes
dd if=/dev/zero of=1445.img bs=1024 count=1 seek=1536k
parted -s 1445.img -- mklabel msdos mkpart primary 1m 1.5g toggle 1 boot
losetup --show -f 1445.img
# prints out `/dev/loopX`, enter this on the next lin
partprobe /dev/loop0
# only have to make the filesytem once --> if you are troubleshooting steps, do not redo this line
mkfs -t ext2 /dev/loop0p1
mount /dev/loop0p1 /mnt
debootstrap --verbose --components=main,contrib,non-free \
--include=firmware-realtek,linux-image-amd64,grub-pc,ssh,vim \
--exclude=nano \
--arch amd64 jessie /mnt http://ftp.us.debian.org/debian
bileşenlerinin kullanımı hakkında bilgi kaynağı
Çekirdeğin kurulduğundan emin olun
/boot, kroot içinde, yani aşağıdaki dosyalarla birlikte görünmelidir/mnt/boot:initrd.img-3.16.0-4-amd64vmlinuz-3.16.0-4-amd64config-3.16.0-4-amd64System.map-3.16.0-4-amd64
grub yükle
grub-install --boot-directory=/mnt/boot --modules=part_msdos /dev/loop0APT'yi kur
apt kaynakları üzerinden kopyala
cp /etc/apt/sources.list /mnt/etc/apt/sources.listcdrom kaynağının yorumlandığından emin olun
satırı ekle:
deb http://ftp.debian.org/debian stable-backports main contrib non-free
Bir chroot ayarlayın
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
# if you want your pushprofilesettings
cp ~/.bashrc /mnt/root/
cp ~/.vimrc /mnt/root/
# chroot -- enter the system as if it were thy own
chroot /mnt /bin/bash
export HOME=/root
export LC_ALL=C
export LANG=C.UTF-8
export TERM=xterm-256color
mount dan adam montaj :
--bind Remount bir alt ağacı başka bir yerde (içeriği her iki yerde de mevcuttur).
-t <type>Dosya sistemi türünün bağlanması , bununla birlikte, mountotomatik olarak
seri / konsol erişimini ayarla
düzenleme /etc/default/grub:
Şuna ayarla
GRUB_CMDLINE_LINUX="":GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"uncomment
GRUB_TERMINAL=consoleAltına, satırı ekleyin:
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
Grub yapılandırma yap - Bu GEREKİR olmayan bir yapılabilir systemd-nspawnkabuk (yani araçlar chroot )
grub-mkconfig -o /boot/grub/grub.cfg
Chroot'tan çık
exit
Chrooted için temizleyin
umount /mnt/sys
umount /mnt/dev
umount /mnt/dev/pts
umount /mnt/proc
Ek bağlar için kontrol edebilir: mount | grep /mnt ve daha sonra bunları kaldırmak umount
Systemd-nspawn girin
systemd-nspawn -D /mnt
# not you are in a special container
İçin şifre ayarlayın rootilepasswd
In /etc/ssh/sshd_configdışarı yorumun PermitRootLogin without-passwordokumak #PermitRootLogin without-passwordve insert PermitRootLogin yesaltındaki
Şimdi başlangıçta ssh'yi etkinleştirin
systemctl enable ssh
Temizlemek
# this is needed to clean up both chroot and systemd-nspawn -D /mnt
# once this is run you can not do systemd-nspawn either so wait until you are entirely done
exit
umount /mnt
losetup -d /dev/loop0
mount | grep /mnt Aşağıdaki ek montaj parçalarını kontrol edin: HERHANGİ BİR şey iade edilirse , umount
Kurtar (yalnızca HATA'da gerekli)
Bir şeyi kırdıysanız veya tekrar denemeniz gerekiyorsa, mevcut durumda RE-MOUNT / SETUP CHROOT .img :
losetup --show -f 1445.img
# prints out `/dev/loopX`, enter this on the next lin
partprobe /dev/loop0
mount /dev/loop0p1 /mnt
img testi
qemu-system-x86_64 -hda 1445.img -m 1024 -vnc :0


sudo debootstrap --components=main,contrib,nonfree --variant=minbase --include=linux-generic,grub-pc --arch=i386 xenial /mnt.