Compare commits

..

5 Commits

Author SHA1 Message Date
Kroese
a1d0bd167d
Update reset.sh 2025-03-17 11:52:30 +01:00
Kroese
36d3fca4fc
fix: Fallback to POSIX fallocate (#932)
Some checks are pending
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-03-17 11:19:04 +01:00
Kroese
89b28f36d3
docs: Disk pass-through (#930)
Some checks failed
Update / dockerHubDescription (push) Has been cancelled
2025-03-16 12:30:06 +01:00
Kroese
b4f7d70a7a
docs: Readme (#929)
Some checks are pending
Update / dockerHubDescription (push) Waiting to run
2025-03-16 06:52:14 +01:00
Kroese
902bafbd0c
docs: Readme (#928) 2025-03-16 06:40:38 +01:00
4 changed files with 36 additions and 21 deletions

View File

@ -74,7 +74,9 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
- Start the container and connect to [port 5000](http://localhost:5000) using your web browser. - Start the container and connect to [port 5000](http://localhost:5000) using your web browser.
- Wait until DSM is ready, choose an username and password, and you will be taken to the desktop. - Wait until DSM finishes its installation
- Choose an username and password, and you will be taken to the desktop.
Enjoy your brand new NAS, and don't forget to star this repo! Enjoy your brand new NAS, and don't forget to star this repo!
@ -103,7 +105,7 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
### How do I create a growable disk? ### How do I create a growable disk?
By default, the entire capacity of the disk is reserved in advance. By default, the entire capacity of the disk will be reserved in advance.
To create a growable disk that only allocates space that is actually used, add the following environment variable: To create a growable disk that only allocates space that is actually used, add the following environment variable:
@ -127,20 +129,21 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
### How do I pass-through a disk? ### How do I pass-through a disk?
It is possible to pass-through a disk device directly, by adding it to your compose file in this way: It is possible to pass-through a disk device directly, which can be useful when your host is a virtual machine, as it removes an extra layer and allows for easier management. For use with physical disks this method provides little advantage and is not recommended.
You can add the virtual device to your compose file like this:
```yaml ```yaml
devices: devices:
- /dev/disk/by-uuid/12345-12345-12345-12345-12345:/disk2 - /dev/disk/by-uuid/12345-12345-12345-12345-12345:/disk2
``` ```
The device needs to be totally empty (without any partition table) otherwise DSM does not always format it into a volume.
Make sure to bind the disk via its UUID (obtainable via `lsblk -o name,uuid`) instead of its name (`/dev/sdc`), to prevent ever binding the wrong disk when the drive letters happen to change. Make sure to bind the disk via its UUID (obtainable via `lsblk -o name,uuid`) instead of its name (`/dev/sdc`), to prevent ever binding the wrong disk when the drive letters happen to change.
> [!IMPORTANT]
> The device needs to be totally empty (without any partition table) otherwise DSM does not always format it into a volume.
> [!CAUTION] > [!CAUTION]
> Do NOT use this feature with the goal of sharing files from the host, they will all be lost without warning when DSM creates the volume. > Do NOT use this feature with the goal of sharing files from the host, they might all get lost without warning when DSM creates the volume.
### How do I change the amount of CPU or RAM? ### How do I change the amount of CPU or RAM?
@ -256,7 +259,7 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
With this method, it is even possible to switch back and forth between versions while keeping your file data intact. With this method, it is even possible to switch back and forth between versions while keeping your file data intact.
If you don't have internet access, it's also possible to skip the download by setting URL to: If you don't have internet access, it's also possible to skip the download by setting `URL` to:
```yaml ```yaml
environment: environment:

View File

@ -141,12 +141,14 @@ createDisk() {
else else
# Create an empty file # Create an empty file
if ! fallocate -l "$DATA_SIZE" "$DISK_FILE"; then if ! fallocate -l "$DATA_SIZE" "$DISK_FILE" &>/dev/null; then
if ! fallocate -l -x "$DATA_SIZE" "$DISK_FILE"; then
if ! truncate -s "$DATA_SIZE" "$DISK_FILE"; then if ! truncate -s "$DATA_SIZE" "$DISK_FILE"; then
rm -f "$DISK_FILE" rm -f "$DISK_FILE"
error "$FAIL" && exit 77 error "$FAIL" && exit 77
fi fi
fi fi
fi
fi fi
;; ;;
@ -219,11 +221,13 @@ resizeDisk() {
else else
# Resize file by allocating more space # Resize file by allocating more space
if ! fallocate -l "$DATA_SIZE" "$DISK_FILE"; then if ! fallocate -l "$DATA_SIZE" "$DISK_FILE" &>/dev/null; then
if ! fallocate -l -x "$DATA_SIZE" "$DISK_FILE"; then
if ! truncate -s "$DATA_SIZE" "$DISK_FILE"; then if ! truncate -s "$DATA_SIZE" "$DISK_FILE"; then
error "$FAIL" && exit 75 error "$FAIL" && exit 75
fi fi
fi fi
fi
fi fi
;; ;;
@ -296,11 +300,13 @@ convertDisk() {
if [[ "$ALLOCATE" != [Nn]* ]]; then if [[ "$ALLOCATE" != [Nn]* ]]; then
# Work around qemu-img bug # Work around qemu-img bug
CUR_SIZE=$(stat -c%s "$TMP_FILE") CUR_SIZE=$(stat -c%s "$TMP_FILE")
if ! fallocate -l "$CUR_SIZE" "$TMP_FILE"; then if ! fallocate -l "$CUR_SIZE" "$TMP_FILE" &>/dev/null; then
if ! fallocate -l -x "$CUR_SIZE" "$TMP_FILE"; then
error "Failed to allocate $CUR_SIZE bytes for $DISK_DESC image $TMP_FILE" error "Failed to allocate $CUR_SIZE bytes for $DISK_DESC image $TMP_FILE"
fi fi
fi fi
fi fi
fi
rm -f "$SOURCE_FILE" rm -f "$SOURCE_FILE"
mv "$TMP_FILE" "$DST_FILE" mv "$TMP_FILE" "$DST_FILE"

View File

@ -328,12 +328,14 @@ if [[ "${FS,,}" == "btrfs" ]]; then
fi fi
fi fi
if ! fallocate -l "$SYSTEM_SIZE" "$SYSTEM"; then if ! fallocate -l "$SYSTEM_SIZE" "$SYSTEM" &>/dev/null; then
if ! fallocate -l -x "$SYSTEM_SIZE" "$SYSTEM"; then
if ! truncate -s "$SYSTEM_SIZE" "$SYSTEM"; then if ! truncate -s "$SYSTEM_SIZE" "$SYSTEM"; then
rm -f "$SYSTEM" rm -f "$SYSTEM"
error "Could not allocate file $SYSTEM for the system disk." && exit 98 error "Could not allocate file $SYSTEM for the system disk." && exit 98
fi fi
fi fi
fi
PART="$TMP/partition.fdisk" PART="$TMP/partition.fdisk"

View File

@ -68,6 +68,10 @@ CPU="${CPU// 8 Core/}"
CPU="${CPU// 16 Core/}" CPU="${CPU// 16 Core/}"
CPU="${CPU// 32 Core/}" CPU="${CPU// 32 Core/}"
CPU="${CPU// 64 Core/}" CPU="${CPU// 64 Core/}"
CPU="${CPU//12th Gen /}"
CPU="${CPU//13th Gen /}"
CPU="${CPU//14th Gen /}"
CPU="${CPU//15th Gen /}"
CPU="${CPU// Processor/}" CPU="${CPU// Processor/}"
CPU="${CPU// Quad core/}" CPU="${CPU// Quad core/}"
CPU="${CPU// Core TM/ Core}" CPU="${CPU// Core TM/ Core}"