Иметь Arch Linux, хочешь расслабиться, должен держать оба; нет CD, нет USB или денег; может chroot, предварительно разделенный: GPT

1043
averagejoey2000

У меня есть ноутбук с Arch Linux на нем

[averagejoey2000@JoeyHobbyPCarchLinux arch-install-scripts]$ lsblk -l NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 596.2G 0 disk  sda1 8:1 0 25G 0 part / sda2 8:2 0 2M 0 part  sda3 8:3 0 512M 0 part /boot sda4 8:4 0 4G 0 part [SWAP] sda5 8:5 0 4G 0 part [SWAP] sda6 8:6 0 266.3G 0 part /home sda7 8:7 0 296.3G 0 part  

Я собираюсь установить Slackware Linux на / dev / sda7 и выше. У меня нет пустых DVD-дисков для установки на основе ISO, dd if = usbboot.img из = / dev / sdb дает мне меню загрузки, но мой компьютер перегревается до того, как он прогрессирует. на отдельном ноутбуке вместо перегрева он ждет 3 часа вместо обещанных двух минут. У меня нет ни денег, ни терпения, чтобы заказать и дождаться отправки по почте на DVD, приобретенной для того, чтобы испытать на себе трудности с slackware. Я хочу быть в состоянии

mkdir /mnt/slack mount /dev/sda7 /mnt/slack (can't remember the command) proc proc proc/ slackinst 

но я хочу добраться до детали перед монтажом, если это вообще возможно.

TL; DR: есть Arch Linux, хотите расслабиться, должны сохранить оба; нет CD, нет USB или денег; может chroot, предварительно разделенный: GPT

0

2 ответа на вопрос

0
QuasarDonkey

You could try something like this, though I'm not certain if it work out for you. It might require some command line wizardry.

The first thing you need to do is mount the usbboot.img file:

$ mkdir /tmp/usbboot $ sudo mount usbboot.img /tmp/usbboot 

Then copy the initrd.img from it and unmount:

$ cp /tmp/usbboot/initrd.img /tmp/ $ sudo umount /tmp/usbboot $ rmdir /tmp/usbboot 

So now the initrd is in /tmp. But what is it?

$ cd /tmp $ file initrd.img initrd.img: gzip compressed data, from Unix, last modified: Fri Nov 1 01:07:44 2013, max compression 

Ah, it's gzipped. Decompress it by renaming to .gz and decompressing:

$ mv initrd.img{,.gz} $ gzip -d initrd.img.gz 

Now what is it?

$ file initrd.img initrd.img: ASCII cpio archive (SVR4 with no CRC) 

Now make a new directory for the slackware installer, and extract initrd using cpio (you need to be root for all the permissions to be right):

$ mkdir slackboot $ cd slackboot $ su # cat ../initrd.img | cpio -i 

NOTE: cpio will extract all its files to the current directory, so make sure you're inside the directory you want the files in when calling. It wouldn't try it from /.

You can chroot now and test it out:

# chroot . # /usr/lib/setup/setup Error opening terminal: xterm. 

It seems you need a real tty/pty/whatever. So log in to one of your real (non-X11) terminals as root (ctrl+alt+2).

# mount -o bind /dev /tmp/slackboot/dev # mount -o bind /sys /tmp/slackboot/sys # mount -o bind /proc /tmp/slackboot/proc # chroot /tmp/slackboot # /usr/lib/setup/setup 

That will launch the installer, and should get you started. Don't blame me if you nuke your harddrive though.

Вам также нужно как-то сделать основной ISO доступным для установщика (возможно, скопируйте ISO в каталог slackboot и смонтируйте изнутри среды chroot). QuasarDonkey 9 лет назад 0
0
MariusMatutiae

The easiest solution is to use Grub2's ability to boot from an iso image, which you presumably already have, or may obtain. Assuming it is called slack.iso, (all commands as sudo)

 mkdir /boot/iso cp /path/to/your/slack.iso /boot/iso 

Now edit the file /etc/grub.d/40_custom and insert these lines:

 #!/bin/sh echo "Adding 40_custom." >&2 exec tail -n +4 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry "Slackware ISO" { set isofile="/boot/iso/slack.iso" loopback loop (hd0,3)$isofile linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject initrd (loop)/casper/initrd.lz } 

Now save, and update grub:

 update-grub 

Reboot, choose the new entry, you shoudl see the live Slack boot.

If you now wish to install, you must remember that you cannot install to a disk in use, bt, since your live image has already been loaded into RAM, there is nothing to worry about: as sudo,

 umount -l /isodevice 

and you are ready to start installing. Just make sure you choose the right (i.e. empty) partition to install to.

NB: if you are booting from efi, you will need to replace the linux line in 40_custom with:

 linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject 

NB2: at the cost of restating the obvious, I would also like to point out that, for the purpose of testing, by far the simplest thing to install a new OS is to do so inside a Virtual Machine. I cannot see the purpose of having two production machines on the same pc, since they cannot run concurrently. A VM instead can be run at the same time as the host OS, can share with it the whole disk, can be easily erased or relocated to a different pc, and so on.

(hd0, 3) вещь выглядит как грубое наследие. Разве это не должно быть sd [AZ] [0-9]? averagejoey2000 9 лет назад 0