diff --git a/scripts/menus/storage_menu.sh b/scripts/menus/storage_menu.sh index e42edeb..af3141f 100644 --- a/scripts/menus/storage_menu.sh +++ b/scripts/menus/storage_menu.sh @@ -6,8 +6,8 @@ # Author : MacRimi # Copyright : (c) 2024 MacRimi # License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE) -# Version : 1.0 -# Last Updated: 28/01/2025 +# Version : 1.1 +# Last Updated: 15/04/2025 # ========================================================== @@ -25,31 +25,32 @@ initialize_cache # ========================================================== - while true; do - OPTION=$(whiptail --title "$(translate "Disk and Storage Menu")" --menu "$(translate "Select an option:")" 20 70 8 \ - "1" "$(translate "Add Disk Passthrough to a VM")" \ - "2" "$(translate "Import Disk Image to a VM")" \ - "3" "$(translate "Return to Main Menu")" 3>&1 1>&2 2>&3) +while true; do + OPTION=$(whiptail --title "$(translate "Disk and Storage Manager Menu")" --menu "$(translate "Select an option:")" 20 70 10 \ + "1" "$(translate "Add Disk Passthrough to a VM")" \ + "2" "$(translate "Add Disk") Passthrough $(translate "to a CT")" \ + "3" "$(translate "Import Disk Image to a VM")" \ + "4" "$(translate "Return to Main Menu")" 3>&1 1>&2 2>&3) + + case $OPTION in + 1) + msg_info2 "$(translate "Running script: Add Disk Passthrough to a VM")..." + bash <(curl -s "$REPO_URL/scripts/storage/disk-passthrough.sh") + ;; + 2) + msg_info2 "$(translate "Running script: Add Disk Passthrough to a CT")..." + bash <(curl -s "$REPO_URL/scripts/storage/disk-passthrough_ct.sh") + ;; + 3) + msg_info2 "$(translate "Running script: Import Disk Image to a VM")..." + bash <(curl -s "$REPO_URL/scripts/storage/import-disk-image.sh") + ;; + 4) + exec bash <(curl -s "$REPO_URL/scripts/menus/main_menu.sh") + ;; + *) + exec bash <(curl -s "$REPO_URL/scripts/menus/main_menu.sh") + ;; + esac +done - case $OPTION in - 1) - msg_info2 "$(translate "Running script:") $(translate "Disk") Passthrough..." - bash <(curl -s "$REPO_URL/scripts/disk-passthrough.sh") - if [ $? -ne 0 ]; then - msg_warn "$(translate "Operation cancelled.")" - sleep 2 - fi - ;; - 2) - msg_info2 "$(translate "Running script:") $(translate "Import Disk Image")..." - bash <(curl -s "$REPO_URL/scripts/import-disk-image.sh") - if [ $? -ne 0 ]; then - msg_warn "$(translate "Operation cancelled.")" - sleep 2 - fi - ;; - - 3) exec bash <(curl -s "$REPO_URL/scripts/menus/main_menu.sh") ;; - *) exec bash <(curl -s "$REPO_URL/scripts/menus/main_menu.sh") ;; - esac - done diff --git a/web/app/docs/storage/disk-passthrough-ct/page.tsx b/web/app/docs/storage/disk-passthrough-ct/page.tsx new file mode 100644 index 0000000..3a5340e --- /dev/null +++ b/web/app/docs/storage/disk-passthrough-ct/page.tsx @@ -0,0 +1,163 @@ +import { Steps } from "@/components/ui/steps" +import { HardDrive, ArrowRight } from "lucide-react" +import { ImageWithCaption } from "@/components/ui/image-with-caption" +import type { Metadata } from "next" + +export const metadata: Metadata = { + title: "Disk Passthrough to a CT | ProxMenux Documentation", + description: "Step-by-step guide to configure disk passthrough to a container (CT) in Proxmox VE using ProxMenux.", + openGraph: { + title: "Disk Passthrough to a CT | ProxMenux Documentation", + description: "Step-by-step guide to configure disk passthrough to a container (CT) in Proxmox VE using ProxMenux.", + type: "article", + url: "https://macrimi.github.io/ProxMenux/docs/disk-ct", + images: [ + { + url: "https://macrimi.github.io/ProxMenux/disk-ct/disk-selection.png", + width: 1200, + height: 630, + alt: "Disk Passthrough to a CT", + }, + ], + }, + twitter: { + card: "summary_large_image", + title: "Disk Passthrough to a CT | ProxMenux Documentation", + description: "Step-by-step guide to configure disk passthrough to a container (CT) in Proxmox VE using ProxMenux.", + images: ["https://macrimi.github.io/ProxMenux/disk-ct/disk-selection.png"], + }, +} + +export default function DiskPassthroughCT() { + return ( +
+ This guide explains how to assign a dedicated physical disk to a container (CT) in{" "} + Proxmox VE using ProxMenux. Assigning a full disk to a container is useful + when you need isolation, ease of access, or the ability to move the disk between systems, especially for + services handling large volumes of data such as Samba, Nextcloud, or video surveillance software, among others. +
+ ++ While it's more common to passthrough entire disks to virtual machines (VMs), there are scenarios where giving + full disk access to an LXC container can be very useful. +
+ ++ As you can see, there are many different use cases where assigning a physical disk directly to a CT is the ideal + solution. +
+ +The user selects the destination LXC container (CT) to which the disk will be assigned.
++ The script lists all physical disks, excluding those used by the system. It also displays metadata like ZFS, + LVM, and RAID, and shows warnings if the disk is already in use. +
+The script performs the following actions:
+/mnt/disk_passthrough
).
+ + The selected disk is mounted inside the container at the specified path, and permissions are set + automatically. +
+Important:
++ The container must be privileged to allow direct read/write access to the physical disk. +
+