Coder Social home page Coder Social logo

Comments (8)

bretton avatar bretton commented on August 12, 2024 1

This is solved for 4 drive systems

from depenguin-run.

bretton avatar bretton commented on August 12, 2024

Hi @nkfilis - you can edit the custom bsdinstall script, see issue 49

(see also https://depenguin.me/bsdinstall.html )

edit: looks like that was from a test version, which might have been lost with follow-up commits. There may be some work involved still, sorry!

from depenguin-run.

bretton avatar bretton commented on August 12, 2024

We need to solve:

  • max 4 drives on the default disk driver
  • extra drives with if=virtio?
  • logic to determine if 1,2,4,6 drives in play

qemu-system-x86_64 binary: 4 drives

disks=(
  -drive "file=/dev/sda,format=raw" \
  -drive "file=/dev/sdb,format=raw" \
  -drive "file=/dev/sdc,format=raw" \
  -drive "file=/dev/sdd,format=raw" \
)

qemu-system-x86_64 binary: 6 drives

disks=(
  -drive "file=/dev/sda,format=raw" \
  -drive "file=/dev/sdb,format=raw" \
  -drive "file=/dev/sdc,format=raw" \
  -drive "file=/dev/sdd,format=raw" \
  -drive "file=/dev/sde,if=virtio,format=raw" \
  -drive "file=/dev/sdf,if=virtio,format=raw" \
)

I don't have capacity currently, leaving as note for now.

from depenguin-run.

bretton avatar bretton commented on August 12, 2024

I have a test script for 4 drives from https://github.com/bretton/mfsbsd-13.1-script/blob/main/depenguinme.sh

wget https://depenguin.me/specialtest.sh
chmod +x specialtest.sh 
./specialtest.sh [ -d ] [ -r ram ] [ -m (url of own mfsbsd image) ] authorized_keys ... 

untested, no machine to test it on yet

from depenguin-run.

bretton avatar bretton commented on August 12, 2024

to factor in somehow

# get list of sd devices
ls -l /dev /dev/mapper |grep '^b' |grep sd |sed 's/[0-9]//g' |awk -F ": " '{print $2}' |sort |uniq

# get list nvme
ls -l /dev /dev/mapper |grep '^b' |grep nvme |sed 's/[0-9]//g' |awk -F ": " '{print $2}' |sort |uniq

from depenguin-run.

bretton avatar bretton commented on August 12, 2024

I revived the 4 disk solution and put in a branch here

It's available for testing as follows:

wget https://depenguin.me/fourdisktest.sh \
&& chmod +x fourdisktest.sh \
&& ./fourdisktest.sh https://example.org/mypubkey

I don't have a 4 disk host yet to experiment with.

from depenguin-run.

bretton avatar bretton commented on August 12, 2024

The only 4 drive server at Hetzner currently is the SX64 with 4 x 16TB SATA disks at €150 cost for one month to test.

The other SX servers have 2 x SSD that can be installed to, and 10x16TB or 14x16TB drives configured post-install.

There are servers in server auction with 4 drives, and other providers might have 4 drive systems?

Keen to test this, however the bare metal landscape seems to be 2 disk servers?

Low priority for now.

from depenguin-run.

bretton avatar bretton commented on August 12, 2024
# get list of sd devices
ls -l /dev /dev/mapper |grep '^b' |grep sd |sed 's/[0-9]//g' |awk -F ": " '{print $2}' |sort |uniq

# get list nvme
ls -l /dev /dev/mapper |grep '^b' |grep nvme |sed 's/[0-9]//g' |awk -F ": " '{print $2}' |sort |uniq

There is also this to get all type 8 devices (misses nvme?)

lsblk -o NAME -n --scsi -I 8

The function find_suitable_disks at https://github.com/terem42/zfs-hetzner-vm/blob/master/hetzner-ubuntu22-zfs-setup.sh might be another way to get a list of suitable disks in linux for mounting in to mfsbsd

function find_suitable_disks {
  # shellcheck disable=SC2119
  print_step_info_header

  udevadm trigger

  # shellcheck disable=SC2012
  ls -l /dev/disk/by-id | tail -n +2 | perl -lane 'print "@F[8..10]"' > "$c_disks_log"

  local candidate_disk_ids
  local mounted_devices

  candidate_disk_ids=$(find /dev/disk/by-id -regextype awk -regex '.+/(ata|nvme|scsi)-.+' -not -regex '.+-part[0-9]+$' | sort)
  mounted_devices="$(df | awk 'BEGIN {getline} {print $1}' | xargs -n 1 lsblk -no pkname 2> /dev/null | sort -u || true)"

  while read -r disk_id || [[ -n "$disk_id" ]]; do
    local device_info

    device_info="$(udevadm info --query=property "$(readlink -f "$disk_id")")"
    block_device_basename="$(basename "$(readlink -f "$disk_id")")"

    if ! grep -q '^ID_TYPE=cd$' <<< "$device_info"; then
      if ! grep -q "^$block_device_basename\$" <<< "$mounted_devices"; then
        v_suitable_disks+=("$disk_id")
      fi
    fi

    cat >> "$c_disks_log" << LOG

## DEVICE: $disk_id ################################

$(udevadm info --query=property "$(readlink -f "$disk_id")")

LOG

  done < <(echo -n "$candidate_disk_ids")

  if [[ ${#v_suitable_disks[@]} -eq 0 ]]; then
    local dialog_message='No suitable disks have been found!

If you think this is a bug, please open an issue on https://github.com/terem42/zfs-hetzner-vm/issues, and attach the file `'"$c_disks_log"'`.
'
    dialog --msgbox "$dialog_message" 30 100

    exit 1
  fi

  print_variables v_suitable_disks
}

function select_disks {
  # shellcheck disable=SC2119
  print_step_info_header

  while true; do
    local menu_entries_option=()

    if [[ ${#v_suitable_disks[@]} -eq 1 ]]; then
      local disk_selection_status=ON
    else
      local disk_selection_status=OFF
    fi

    for disk_id in "${v_suitable_disks[@]}"; do
      menu_entries_option+=("$disk_id" "($block_device_basename)" "$disk_selection_status")
    done

    local dialog_message="Select the ZFS devices (multiple selections will be in mirror).

Devices with mounted partitions, cdroms, and removable devices are not displayed!
"
    mapfile -t v_selected_disks < <(dialog --separate-output --checklist "$dialog_message" 30 100 $((${#menu_entries_option[@]} / 3)) "${menu_entries_option[@]}" 3>&1 1>&2 2>&3)

    if [[ ${#v_selected_disks[@]} -gt 0 ]]; then
      break
    fi
  done

  print_variables v_selected_disks
}

from depenguin-run.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.