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 37 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.
- 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!
@ -103,7 +105,7 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
### 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:
@ -127,20 +129,21 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
### 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
devices:
- /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.
> [!IMPORTANT]
> The device needs to be totally empty (without any partition table) otherwise DSM does not always format it into a volume.
> [!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?
@ -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.
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
environment:

View File

@ -141,10 +141,12 @@ createDisk() {
else
# Create an empty file
if ! fallocate -l "$DATA_SIZE" "$DISK_FILE"; then
if ! truncate -s "$DATA_SIZE" "$DISK_FILE"; then
rm -f "$DISK_FILE"
error "$FAIL" && exit 77
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
rm -f "$DISK_FILE"
error "$FAIL" && exit 77
fi
fi
fi
@ -219,9 +221,11 @@ resizeDisk() {
else
# Resize file by allocating more space
if ! fallocate -l "$DATA_SIZE" "$DISK_FILE"; then
if ! truncate -s "$DATA_SIZE" "$DISK_FILE"; then
error "$FAIL" && exit 75
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
error "$FAIL" && exit 75
fi
fi
fi
@ -296,8 +300,10 @@ convertDisk() {
if [[ "$ALLOCATE" != [Nn]* ]]; then
# Work around qemu-img bug
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"
fi
fi
fi
fi

View File

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

View File

@ -63,10 +63,15 @@ if [ -z "${CPU// /}" ] && grep -qi "model:" <<< "$CPI"; then
fi
CPU="${CPU// CPU/}"
CPU="${CPU// 6 Core/}"
CPU="${CPU// 8 Core/}"
CPU="${CPU// 16 Core/}"
CPU="${CPU// 32 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// Quad core/}"
CPU="${CPU// Core TM/ Core}"