Sign up
Login
New
Trending
Archive
English
English
Sign up
Login
New Paste
Add Image
#!/bin/bash # Script d'installation Automatique Chainloader Gen8 # A copier sur pastebin.com (RAW) echo "=== Gen8 Chainloader Auto-Installer ===" echo "ATTENTION : Ce script va effacer la carte SD/USB cible." # 1. Detection des disques lsblk -o NAME,MODEL,SIZE,TYPE,FSTYPE echo "" echo "Identifiez votre carte MicroSD ou clé USB Chainloader (ex: sdb, sdc)." echo "Ne choisissez PAS sda (votre SSD TrueNAS)!" read -p "Entrez le nom du device (ex: sdb) : " DISK DEVICE="/dev/$DISK" if; then echo "Erreur: $DEVICE n'existe pas." exit 1 fi echo "Vous avez choisi : $DEVICE" read -p "Etes-vous sur de vouloir TOUT EFFACER sur $DEVICE? (y/n) " CONFIRM if; then echo "Annulation." exit 0 fi # 2. Preparation Disque echo "[+] Nettoyage et Partitionnement..." umount ${DEVICE}* 2>/dev/null parted -s $DEVICE mklabel msdos parted -s $DEVICE mkpart primary ext2 1MiB 100% parted -s $DEVICE set 1 boot on mdev -s 2>/dev/null # Refresh devices sleep 2 # 3. Formatage echo "[+] Formatage ext2..." mkfs.ext2 ${DEVICE}1 > /dev/null # 4. Montage echo "[+] Montage..." mkdir -p /mnt/chainboot mount ${DEVICE}1 /mnt/chainboot # 5. Installation GRUB echo "[+] Installation GRUB (i386-pc)..." grub-install --target=i386-pc --boot-directory=/mnt/chainboot/boot $DEVICE # 6. Configuration GRUB Dynamique echo "[+] Creation grub.cfg..." cat > /mnt/chainboot/boot/grub/grub.cfg <<EOF set timeout=2 set default=0 insmod part_gpt insmod part_msdos insmod zfs insmod ext2 insmod chain menuentry "TrueNAS SCALE (Auto-Detect Gen8)" { echo "Scanning ports for TrueNAS..." # On scanne les ports SATA 5 a 0 # TrueNAS cree generalement une partition BIOS boot (1) ou EFI (2) et ZFS (3) # On cherche la partition 3 (ZFS) pour identifier le disque for i in 5 4 3 2 1 0; do if [ -e (hd\$i,gpt3) ]; then echo "Found TrueNAS on hd\$i" set root=(hd\$i) chainloader +1 boot fi done echo "Erreur: TrueNAS introuvable. Verifiez le mode BIOS/Legacy." sleep 10 } EOF # 7. Finalisation echo "[+] Termine!" umount /mnt/chainboot echo "Vous pouvez redemarrer. Retirez la cle d'installation." reboot
Settings
Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English