mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 04:06:54 +00:00
update menu storage and new script
This commit is contained in:
parent
5022905047
commit
94acab3030
@ -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 \
|
||||
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 "Import Disk Image to a VM")" \
|
||||
"3" "$(translate "Return to Main Menu")" 3>&1 1>&2 2>&3)
|
||||
"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:") $(translate "Disk") Passthrough..."
|
||||
bash <(curl -s "$REPO_URL/scripts/disk-passthrough.sh")
|
||||
if [ $? -ne 0 ]; then
|
||||
msg_warn "$(translate "Operation cancelled.")"
|
||||
sleep 2
|
||||
fi
|
||||
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:") $(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
|
||||
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")
|
||||
;;
|
||||
|
||||
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
|
||||
done
|
||||
|
||||
|
163
web/app/docs/storage/disk-passthrough-ct/page.tsx
Normal file
163
web/app/docs/storage/disk-passthrough-ct/page.tsx
Normal file
@ -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 (
|
||||
<div className="max-w-3xl mx-auto">
|
||||
<div className="flex items-center mb-6">
|
||||
<HardDrive className="h-8 w-8 mr-2 text-blue-500" />
|
||||
<ArrowRight className="h-5 w-5 mr-2 text-gray-500" />
|
||||
<h1 className="text-3xl font-bold">
|
||||
Disk Passthrough to a <span className="text-blue-500">CT</span>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<p className="mb-4">
|
||||
This guide explains how to assign a <strong>dedicated physical disk</strong> to a container (CT) in{" "}
|
||||
<strong>Proxmox VE</strong> using <strong>ProxMenux</strong>. 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.
|
||||
</p>
|
||||
|
||||
<p className="mb-4">
|
||||
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.
|
||||
</p>
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 space-y-1">
|
||||
<li>
|
||||
A user running a video surveillance system like <strong>Frigate</strong> or <strong>Agent DVR</strong> might
|
||||
want recordings saved on a dedicated disk, so they can easily transfer it to another system for review.
|
||||
</li>
|
||||
<li>
|
||||
A <strong>Nextcloud</strong> container might need full disk access to manage user files and take advantage of
|
||||
the entire disk capacity.
|
||||
</li>
|
||||
<li>
|
||||
A container may be used for downloads, storing files on a dedicated disk and sharing them over the local
|
||||
network.
|
||||
</li>
|
||||
<li>Another use case could be writing backups to an isolated disk.</li>
|
||||
</ul>
|
||||
|
||||
<p className="mb-6">
|
||||
As you can see, there are many different use cases where assigning a physical disk directly to a CT is the ideal
|
||||
solution.
|
||||
</p>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-8 mb-4">Description</h2>
|
||||
<ol className="list-decimal pl-6 space-y-2 mb-6">
|
||||
<li>Lists physical disks on the Proxmox host, excluding the system disk and mounted system disks.</li>
|
||||
<li>Displays all existing LXC containers (CTs) for user selection.</li>
|
||||
<li>
|
||||
Allows the user to select <strong>one physical disk</strong> per execution.
|
||||
</li>
|
||||
<li>
|
||||
Formats the disk (with user confirmation) or reuses it, then assigns it as a mount point in the selected CT.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-8 mb-4">Step-by-Step Instructions</h2>
|
||||
<Steps>
|
||||
<Steps.Step title="CT Selection">
|
||||
<ImageWithCaption
|
||||
src="https://macrimi.github.io/ProxMenux/disk/select-container.png"
|
||||
alt="Select CT"
|
||||
caption="CT Selection Menu."
|
||||
/>
|
||||
|
||||
<p>The user selects the destination LXC container (CT) to which the disk will be assigned.</p>
|
||||
</Steps.Step>
|
||||
<Steps.Step title="Disk Detection">
|
||||
<ImageWithCaption
|
||||
src="https://macrimi.github.io/ProxMenux/disk/disk-selection-ct.png"
|
||||
alt="Disk Selection Menu"
|
||||
caption="Disk Selection Menu"
|
||||
/>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
</Steps.Step>
|
||||
<Steps.Step title="Disk Preparation">
|
||||
<p>The script performs the following actions:</p>
|
||||
<ul className="list-disc pl-6 space-y-1 mt-2">
|
||||
<li>Detects whether the disk has a supported filesystem (ext4, xfs, btrfs).</li>
|
||||
<li>Offers to format the disk if no valid filesystem is found.</li>
|
||||
<li>
|
||||
Prompts the user to define the mount point (e.g. <code>/mnt/disk_passthrough</code>).
|
||||
</li>
|
||||
</ul>
|
||||
</Steps.Step>
|
||||
<Steps.Step title="Assignment to CT">
|
||||
<ImageWithCaption
|
||||
src="https://macrimi.github.io/ProxMenux/disk/assignment-ct.png"
|
||||
alt="Assignment to CT"
|
||||
caption="Assignment to CT"
|
||||
/>
|
||||
<p>
|
||||
The selected disk is mounted inside the container at the specified path, and permissions are set
|
||||
automatically.
|
||||
</p>
|
||||
</Steps.Step>
|
||||
</Steps>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-8 mb-4">Expected Results</h2>
|
||||
<ul className="list-disc pl-6 space-y-2 mb-6">
|
||||
<li>The selected disk is successfully mounted and accessible within the specified container.</li>
|
||||
<li>The script shows a summary of the operation, including any warnings or errors.</li>
|
||||
<li>The container can use the assigned storage immediately.</li>
|
||||
<ImageWithCaption
|
||||
src="https://macrimi.github.io/ProxMenux/disk/result-point.png"
|
||||
alt="Mount point created successfully"
|
||||
caption="Mount point created successfully"
|
||||
/>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-8 mb-4">Important Considerations</h2>
|
||||
<div className="bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 mb-4">
|
||||
<p className="font-semibold">Important:</p>
|
||||
<p>
|
||||
The container must be <strong>privileged</strong> to allow direct read/write access to the physical disk.
|
||||
</p>
|
||||
</div>
|
||||
<ul className="list-disc pl-6 space-y-2 mb-6">
|
||||
<li>
|
||||
Only <strong>one disk</strong> can be assigned per script execution.
|
||||
</li>
|
||||
<li>Avoid assigning the same disk to multiple VMs or CTs that may run at the same time, as this can lead to data corruption or file loss.</li>
|
||||
<li>
|
||||
Clean any RAID, ZFS, or LVM metadata <strong>manually</strong> before assigning the disk.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
@ -53,6 +53,7 @@ const sidebarItems: MenuItem[] = [
|
||||
title: "Storage",
|
||||
submenu: [
|
||||
{ title: "Disk Passthrough to a VM", href: "/docs/storage/disk-passthrough-vm" },
|
||||
{ title: "Disk Passthrough to a CT", href: "/docs/storage/disk-passthrough-ct" },
|
||||
{ title: "Import Disk Image to a VM", href: "/docs/storage/import-disk-image-vm" },
|
||||
],
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user