Alternate install method via debootstrap script - 1000001101000/Debian_on_Buffalo GitHub Wiki

Table of Contents

Description

Instead of booting the device into the Debian Installer, this method generates a Debian disk image which can then be written to a hard disk. This approach has a few advantages:

  • It is faster than running the installer on the device in most instances
  • It works for devices with too little memory to run the installer successfully (LS-XL,LS-CHLv2,LS-WTGL)
  • working with a disk image makes it easier to start over if something goes wrong with your install
  • Allows older devices to use disks larger than 2TB (LS-GL, Terastation II and likely other older devices)

Prerequisites

This method is based around debootstrap which is a Debian tool, I typically test it using the latest Debian Stable version though it should work on any system that provides a debootstrap package and qemu support. I've reworked the script to download what it needs from the rep automatically so it is no longer required to clone the repo, you can simply download the script and run it:

To prepare run the following:

  apt-get install qemu-user-static debootstrap qemu-system-arm
  wget https://github.com/1000001101000/Debian_on_Buffalo/raw/refs/heads/master/Tools/debootstrap/generate_disk_image.sh
  wget https://github.com/1000001101000/Debian_on_Buffalo/raw/refs/heads/master/Tools/debootstrap/functions.sh
  chmod +x generate_disk_image.sh

Prepare the script

I've reworked the script to prompt for everything it needs, in most cases it should be as simple as copying the machine name from the table below and answering the prompts.

Machine Values Architecture
Buffalo Linkstation LS210D armhf
Buffalo Linkstation LS220D armhf
Buffalo Linkstation LS410D armhf
Buffalo Linkstation LS420D armhf
Buffalo Linkstation LS421D armhf
Buffalo Linkstation LS441D armhf
Buffalo Terastation TS1200D armhf
Buffalo Terastation TS1400D armhf
Buffalo Terastation TS1400R armhf
Buffalo Terastation TS3200D armhf
Buffalo Terastation TS3400D armhf
Buffalo Terastation TS3400R armhf
Buffalo Nas WXL armel
Buffalo Terastation TS-XEL armel
Buffalo Terastation Pro II/Live armel
Buffalo Linkstation LS-XL armel
Buffalo Linkstation LiveV3 (LS-CHL) armel
Buffalo Linkstation LS-CHLv2 armel
Buffalo Linkstation LS-QL armel
Buffalo Linkstation LS-QVL armel
Buffalo Linkstation LS-VL armel
Buffalo Linkstation LS-WSXL armel
Buffalo Linkstation LS-WTGL armel
Buffalo Linkstation LS-WVL armel
Buffalo Linkstation LS-WXL armel
Buffalo Linkstation LS-XHL armel
Buffalo Linkstation Mini armel
Buffalo Linkstation Mini (LS-WSGL) armel
Buffalo Linkstation Pro/Live armel
Buffalo/Revogear Kurobox Pro armel
Note: "Buffalo Nas WXL" refers to all Terastation III models (Ts-WXL, TS-XL and TS-RXL)

Create the image and write it to a disk

Once all the variables have been set you can run the script:

  ./generate_disk_image.sh
  Enter model string [Buffalo Linkstation LS220D]: 
  Enter debian version [trixie]: 
  Enter default username [debian]: 
  Enter password: 
  Repeat password: 
  Enter root password: 
  Repeat root password: 
  Enter desired hostname [debian]: 
  Setup system partitions for RAID? [Y]: 
  Process started, logging output to debian_trixie_armhf.log
  running debootstrap
  I: Target architecture can be executed
  I: Retrieving InRelease 
  I: Checking Release signature

The process will now give some generic error messages if one of the steps fail. The detailed output from all the commands can be found in the log file created by the process.

Once the script finishes you will have a disk image file named debian_$distro_$arch.img

Once you have your disk image you can write it to your disk by connecting it to your PC via SATA or SATA to USB adapter and using dd or pv:

  dd if=debian_buster_armel.img of=/dev/sdx bs=4k

or

  pv debian_buster_armel.img > /dev/sdx

It's important the you choose the correct disk, you can determine which is which by running lsblk

Post install steps

This process skips a few steps covered by the full Debian installer, here on some notes on steps you can take to complete the installation.

set locale

To change the language/localization settings:

  apt-get install locales
  dpkg-reconfigure locales

convert to gpt

I've re-worked the process to use GPT partition tables since using drives larger than 2TB is half the point of a NAS these days. The oldest supported devices (LS-GL, LS-WTGL, TS2PRO, etc) will only boot from MBR or Hybrid partition tables. I've setup the script to setup the GPT/MBR hybrid table where needed.

For a detailed explanation of why this is needed and how it works see: https://www.rodsbooks.com/gdisk/hybrid.html

Extend RAID arrays to additional disks

~# mdadm /dev/md90 --grow --raid-devices=2 --add /dev/sdb1
mdadm: hot added /dev/sdb1
raid_disks for /dev/md90 set to 2

~# mdadm /dev/md91 --grow --raid-devices=2 --add /dev/sdb2
mdadm: hot added /dev/sdb2
raid_disks for /dev/md91 set to 2

~# mdadm /dev/md92 --grow --raid-devices=2 --add /dev/sdb3
mdadm: hot added /dev/sdb3
raid_disks for /dev/md92 set to 2
~# mdadm --detail /dev/md9[012] | grep State\ :
             State : clean 
             State : clean 
             State : clean

create new data array?

⚠️ **GitHub.com Fallback** ⚠️