Aggiunto scriptazzo hetzner
This commit is contained in:
parent
6969fc3669
commit
15cf7e0776
30
install_zfsonlinux.sh
Executable file
30
install_zfsonlinux.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo -e "\e[31m\e[1mATTENTION\e[0m
|
||||||
|
|
||||||
|
This script will attempt to install the current ZFSonLinux release
|
||||||
|
which is available in the ZFSonLinux git repository to the Rescue
|
||||||
|
System. \e[31m\e[1mIf this script fails, do not contact Hetzner Support, as
|
||||||
|
it is provided AS-IS and Hetzner will not support the installation
|
||||||
|
or usage of ZFSonLinux due to License imcompatiblity (see below)\e[0m.
|
||||||
|
"
|
||||||
|
|
||||||
|
echo -e "\e[31m\e[1mLicenses of ZFS and Linux are incompatible\e[0m
|
||||||
|
|
||||||
|
ZFS is licensed under the Common Development and Distribution License (CDDL),
|
||||||
|
and the Linux kernel is licensed under the GNU General Public License Version 2
|
||||||
|
(GPL-2). While both are free open source licenses they are restrictive
|
||||||
|
licenses. The combination of them causes problems because it prevents using
|
||||||
|
pieces of code exclusively available under one license with pieces of code
|
||||||
|
exclusively available under the other in the same binary.
|
||||||
|
|
||||||
|
Please be aware that distributing of the binaries may lead to infringing.
|
||||||
|
|
||||||
|
Press \e[31m\e[1my\e[0m to accept this."
|
||||||
|
read -p "" -n 1 ;echo
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd $(mktemp -d)
|
||||||
|
wget $(curl -Ls https://api.github.com/repos/zfsonlinux/zfs/releases/latest| grep "browser_download_url.*tar.gz"|grep -E "tar.gz\"$"| cut -d '"' -f 4)
|
||||||
|
apt update && apt install libssl-dev uuid-dev zlib1g-dev libblkid-dev -y && tar xfv zfs*.tar.gz && rm *.tar.gz && cd zfs* && ./configure && make -j $(nproc) && make install && ldconfig && modprobe zfs || echo -e "\e[31m\e[1mInstall failed, please fix manually!\e[0m"
|
|
@ -1,7 +1,20 @@
|
||||||
### ZFS
|
### ZFS
|
||||||
|
|
||||||
|
Installiamo zfs nel sistema live (lo script è fornito direttamente da hetzner,
|
||||||
|
l'ho copiato in questa repo)
|
||||||
|
|
||||||
|
```
|
||||||
|
./install_zfsonlinux.sh
|
||||||
|
```
|
||||||
|
|
||||||
Lanciamo lo script `create_pools.sh`
|
Lanciamo lo script `create_pools.sh`
|
||||||
|
|
||||||
|
```
|
||||||
|
./create_pools.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
(per importare delle pool già esistenti, facciamo `zfs import -f <nome_pool>`).
|
||||||
|
|
||||||
|
|
||||||
### Installazione debian base
|
### Installazione debian base
|
||||||
|
|
||||||
|
@ -94,7 +107,7 @@ passwd
|
||||||
`/etc/systemd/system/zfs-import-bpool.service`) per forzare l'import della pool
|
`/etc/systemd/system/zfs-import-bpool.service`) per forzare l'import della pool
|
||||||
di `/boot`
|
di `/boot`
|
||||||
|
|
||||||
```dosini
|
```ini
|
||||||
[Unit]
|
[Unit]
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Before=zfs-import-scan.service
|
Before=zfs-import-scan.service
|
||||||
|
@ -116,7 +129,7 @@ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debia
|
||||||
|
|
||||||
perl -i -pe 's/(GRUB_CMDLINE_LINUX=")/${1}root=ZFS=rpool /' /etc/default/grub
|
perl -i -pe 's/(GRUB_CMDLINE_LINUX=")/${1}root=ZFS=rpool /' /etc/default/grub
|
||||||
echo 'GRUB_DISABLE_OS_PROBER=true' >> /etc/default/grub
|
echo 'GRUB_DISABLE_OS_PROBER=true' >> /etc/default/grub
|
||||||
update-grub")'
|
update-grub
|
||||||
```
|
```
|
||||||
|
|
||||||
I seguenti passi servono a configurare il boot
|
I seguenti passi servono a configurare il boot
|
||||||
|
|
Loading…
Reference in New Issue
Block a user