[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:slackware_admin:install_slackware_on_a_online.net_dedibox_baremetal_server [2018/05/02 07:38 (UTC)] – [9. Freshly installed Slackware chroot] atelszewski | howtos:slackware_admin:install_slackware_on_a_online.net_dedibox_baremetal_server [2018/05/03 14:33 (UTC)] (current) – [14. Finalising the installation] atelszewski | ||
---|---|---|---|
Line 130: | Line 130: | ||
$ parted /dev/sda set 1 boot on | $ parted /dev/sda set 1 boot on | ||
- | Having the ///boot// // | + | Having the ///boot// // |
$ # Passing "-a optimal" | $ # Passing "-a optimal" | ||
$ # The start and end offsets have to be given explicitly: | $ # The start and end offsets have to be given explicitly: | ||
Line 203: | Line 203: | ||
====== 10. Applying patches ====== | ====== 10. Applying patches ====== | ||
+ | The following set of commands will apply all the available patches and let you know of any //.new// files to deal with: | ||
+ | |||
+ | $ find / | ||
+ | $ find /etc -name \*.new | ||
====== 11. Bootloader (syslinux) ====== | ====== 11. Bootloader (syslinux) ====== | ||
- | ====== 12. initrd ====== | + | The following set of commands will install the // |
+ | $ extlinux --install /boot | ||
+ | $ dd count=1 bs=440 conv=notrunc if=/ | ||
+ | |||
+ | Then, create the // | ||
+ | $ cat << EOF > / | ||
+ | PROMPT | ||
+ | TIMEOUT 0 | ||
+ | DEFAULT vmlinuz-generic | ||
+ | SERIAL | ||
+ | |||
+ | LABEL vmlinuz-generic | ||
+ | KERNEL vmlinuz-generic | ||
+ | APPEND console=ttyS1, | ||
+ | INITRD initrd-generic.gz | ||
+ | EOF | ||
+ | |||
+ | This configuration will enable the messages to appear on the serial console. I also specify some kernel parameters (// | ||
+ | |||
+ | Note that the kernel and initrd paths specified in // | ||
+ | |||
+ | |||
+ | ====== 12. Initial RAM disk (initrd) ====== | ||
+ | Create the //initrd// config file: | ||
+ | $ cat << EOF > / | ||
+ | # mkinitrd.conf | ||
+ | # See "man mkinitrd.conf" | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | OUTPUT_IMAGE="/ | ||
+ | KERNEL_VERSION=" | ||
+ | # | ||
+ | MODULE_LIST=" | ||
+ | # | ||
+ | # | ||
+ | ROOTDEV="/ | ||
+ | ROOTFS=" | ||
+ | # | ||
+ | # | ||
+ | LVM=" | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | WAIT=" | ||
+ | EOF | ||
+ | |||
+ | As the comment says, refer to the // | ||
+ | |||
+ | The notable thing is how the // | ||
+ | $ ls -l / | ||
+ | lrwxrwxrwx 1 root root 22 Dec 13 00:44 / | ||
+ | |||
+ | So the following code: | ||
+ | KERNEL_VERSION=" | ||
+ | |||
+ | will simply extract the version number from the // | ||
+ | |||
+ | And finally, to create the //initrd//, run the following command: | ||
+ | $ mkinitrd -c -F | ||
+ | |||
+ | Note that it is not necessary to run any // | ||
====== 13. Enabling serial console access ====== | ====== 13. Enabling serial console access ====== | ||
+ | As of now, the serial console configuration in /// | ||
+ | s2: | ||
+ | |||
+ | and the following line in /// | ||
+ | ttyS1 | ||
+ | |||
+ | You might also want to comment out the follwing lines in /// | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | and the following lines in /// | ||
+ | #tty1 | ||
+ | #tty2 | ||
+ | #tty3 | ||
+ | #tty4 | ||
+ | #tty5 | ||
+ | #tty6 | ||
+ | |||
+ | // | ||
+ | |||
====== 14. Finalising the installation ====== | ====== 14. Finalising the installation ====== | ||
+ | We're done with the installation and initial configuration of the Slackware Linux. ;-) You can now prepare the system for reboot and, well, reboot. Before doing that, you might also consider looking at the [[#B. SSH server configuration (before rebooting)|Appendix B]], where I explain how to prepare the SSH stuff, so that after rebooting, you can connect to the server with SSH right away. (Otherwise, you will have to log in over serial console to perform the other configuration tasks). | ||
+ | |||
+ | First, prepare the hard disk to safely survive the reboot phase. Note that, I only (u)mount /// | ||
+ | $ # Exit freshly installed Slackware chroot: | ||
+ | $ exit | ||
+ | $ umount -v /mnt/boot | ||
+ | $ mount -v -o remount,ro /mnt | ||
+ | $ # This never hurts: | ||
+ | $ sync | ||
+ | $ # Only needed if LVM2 is used: | ||
+ | $ vgchange -an --ignorelockingfailure | ||
+ | $ # This never hurts again: | ||
+ | $ sync | ||
+ | $ # Shouldn' | ||
+ | $ sleep 3 | ||
+ | |||
+ | Now, go to the server management page and press '' | ||
+ | |||
====== A. Setting up LVM2 disk management ====== | ====== A. Setting up LVM2 disk management ====== | ||
+ | <note important> | ||
+ | |||
+ | Before continuing to LVM2 partitioning, | ||
+ | $ lvscan | ||
+ | $ ( cd /dev/mapper && lvchange -an $(pvs --noheadings -o vg_name) ) | ||
+ | $ vgscan | ||
+ | $ vgchange -an $(pvs --noheadings -o vg_name) | ||
+ | $ pvscan | ||
+ | $ pvremove -ffy $(pvs --noheadings -o pv_name) | ||
+ | $ partprobe | ||
+ | |||
+ | <note tip>To find out more about LVM2, go to https:// | ||
+ | |||
+ | Remember that the disk has already been partitioned using MBR in the " | ||
+ | $ pvcreate /dev/sda2 | ||
+ | $ pvdisplay | ||
+ | $ vgcreate vg0 /dev/sda2 | ||
+ | $ vgdisplay | ||
+ | $ # Create the partitions (logical volumes): | ||
+ | $ lvcreate -L 12G vg0 -n rootfs | ||
+ | $ lvdisplay | ||
+ | $ vgchange -ay | ||
+ | |||
+ | NOTE: | ||
+ | * The good thing about LVM2 is that you can easily add more partitions later on. | ||
+ | * I have chosen partition sizes that suit my current needs, leaving significant free space. LVM2 can easily grow the sizes later on if needed. | ||
+ | * I haven' | ||
+ | |||
====== B. SSH server configuration (before rebooting) ====== | ====== B. SSH server configuration (before rebooting) ====== | ||
+ | < | ||
+ | |||
+ | If you enabled the //sshd// service during //setup//, it'll be automatically started the next time the Slackware system boots. Unfortunately, | ||
+ | - the host keys are not generated yet, so you won't be able to verify host's authenticity and of course you don't want to connect without being able to verify it, | ||
+ | - user's public key authentication is not set up and of course you don't want to be logging in using password | ||
+ | |||
+ | To solve the first issue, we need to manually perform the task that would normally be done by the Slackware init scripts when the system boots for the first time. Generating the host keys basically boils down to the following command: | ||
+ | $ ssh-keygen -A | ||
+ | |||
+ | And then to obtain the host's key fingerprint (I stick to RSA): | ||
+ | $ ssh-keygen -l -f / | ||
+ | |||
+ | Setting up public key authentication is a bit more cumbersome, but still far from being rocket science. :-^ First, you need to upload your public key from your workstation to the server. Run the following command on the workstation: | ||
+ | $ scp -i ./login_key ~/ | ||
+ | |||
+ | NOTE: The above command uploads // | ||
+ | |||
+ | Now, back to the server, create the required //~/.ssh// directory: | ||
+ | $ mkdir ~/.ssh | ||
+ | |||
+ | I told you to use the //screen// program at the beginning, right? :-) Now we will make use of it. The public key that you uploaded above has been placed in the //user// home directory of the Ubuntu rescue OS. We need to rename it to the // | ||
+ | $ # Detach from screen session, you'll be dropped to Ubuntu rescue OS: | ||
+ | (keyboard) Ctrl+a d | ||
+ | $ # Login as root: | ||
+ | $ sudo su - | ||
+ | $ mv / | ||
+ | $ # Exit root login: | ||
+ | $ exit | ||
+ | $ Re-attach to screen session: | ||
+ | $ screen -r | ||
+ | |||
+ | Ensure correct ownership and permissions, | ||
+ | $ chown root:root ~/.ssh | ||
+ | $ chown root:root ~/ | ||
+ | $ chmod 0700 ~/.ssh | ||
+ | $ chmod 0600 ~/ | ||
+ | |||
+ | NOTE: | ||
+ | - If you haven' | ||
+ | - Remember that the correct server' | ||
+ | |||
+ | At this point, all the pieces should be in place and you should be able to successfully login to your fresh Slackware installation after the server is rebooted. | ||
+ | |||
+ | NOTE: I know I allow for root login over SSH. I have to live with that. :-^ | ||
+ | ===== Sources ===== | ||
+ | * Originally written by [[wiki: | ||
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
<!-- You must remove the tag-word " | <!-- You must remove the tag-word " | ||
- | {{tag> | + | {{tag> |