I need to expand my /dev/sda1 because I’m running out of space.
I’ve already expanded the disk in Proxmox.
![]()
Now I just need to expand sda1. Is there a guide for that?
Following command should work: (not tested)
btrfs filesystem resize max /
Since I like to experiment, I figured one of my agents should be able to do this on its own…
So I created a SnapShot and assigned AgentZero to it.
And sure enough.
It worked, and it even created a documentation page on DikuWki right away.
I’m getting (mentally) lazy. Actually, it’s a little unsettling.
Interessing
Do you have the liki of the Dokuwiki page. I can’t find it
Or can you share how you did this.
I want to learn how Agentzero works and what the capabilities are
Thanks
I’d like too !
Personally I use LVM on my VM and I add GB to the virtual HDD, Configure the unallocated space as a new Logical volume and I assign it to the Volume group (from memory). Then I grow the underlying filesystem.
Should I use btrfs ?
By “Dokuwiki,” I meant my personal documentation system based on Dokuwiki.
Agentzero connects to it automatically and independently summarizes its analyses and solutions in a post.
In my opinion, there’s only one best way to get to know A0: install it, read the documentation, integrate LLMs, and give it a try.
If in doubt, just ask your agent for help.
My approach is always to describe the problem and assign the task of conducting an analysis and developing a solution concept. Initially, I used ChatGPT as a quality assurance system to review the concepts before implementation. Sometimes it added good ideas; sometimes it didn’t. I also used ChatGPT for prompt engineering for the agents. In doing so, I noticed that ChatGPT formulates prompts for the same problem in a way that’s specific to each agent.
Since I can fall back on Proxmox snapshots or backups for any system interventions, I’m completely at ease.
It was interesting when I had both the Hermes Agent and AgentZero tackle the same problem using the same LLMs. To do this, I put both bots in a Telegram group so they could talk to each other and come up with ideas. They actually complemented each other and exchanged knowledge. Fascinating.
What’s concerning is that I can no longer really follow what’s happening. Some solutions also seem overly ambitious to me, such as when command-line commands are wrapped in Python.
But whatever—everything happens at lightning speed and gets the job done.
I do it completely differently (or rather, I had it done).
I’ll go with BTRFS—a tip from Andy—since it’s robust.
The prompt was simple:
Analyze the existing hard drive configuration of my NS server with the IP address 192.168.3.21 and create a proposal to expand /dev/sda1 to the maximum available space of the underlying QCOW2 image.
After I approved the proposal, he implemented it. I just had to point out that it was a BFRFS volume; otherwise, someone would have planned for ext4.
Impressive.
How do you run AgentZero and how does it access to your VM and your host ?
I use AgentZero in the app offered for NS. I’ve set up Hermes Agent on its own LXC.
It establishes the connection to other servers automatically using an SSH tunnel.
Initially, I went to great lengths to mask the credentials so they wouldn’t “leak” to the LLMS and would remain purely local.
But as soon as A0 logged in once using root credentials, it established a trusted relationship on its own and now connects automatically via key exchange as needed.
This only happens at the local agent level.
I did it recently on a rockylinux inside a proxmox cluster
Procedure: /home extension vm-101 (ns8-leader) — +300G — 06/15/2026
On the Proxmox host (ns31901998)
bash
zfs list data_1.92
qm resize 101 scsi0 +300G
zfs get volsize data_1.92/vm-101-disk-0
zfs list data_1.92
inside VM ns8-leader :
bash
# State before
lsblk
sudo pvs
sudo vgs
# Rescan the disk
echo 1 | sudo tee /sys/class/block/sda/device/rescan
lsblk
sudo fdisk -l /dev/sda
# Install growpart if missing
sudo dnf install cloud-utils-growpart -y
# Grow partition sda2
sudo growpart /dev/sda 2
sudo fdisk -l /dev/sda
lsblk
# Extend the PV
sudo pvs
sudo pvdisplay
sudo pvresize /dev/sda2
sudo pvs
sudo pvdisplay
# Extend the home LV with all free space
sudo lvs
df -h /home
sudo lvextend -l +100%FREE /dev/mapper/rlm-home
sudo lvs
sudo lvdisplay /dev/mapper/rlm-home
# Extend the XFS filesystem
sudo xfs_growfs /home
df -h /home
sudo vgs
sudo pvs
Result
Probably I’m saying obvious and dumb things since now…
1: “hardware” is a VM. So that’s not hardware related, but hypervisor related.So partially it’s about proxmox
2: OS is… Unclear? @mrmarkuz linked RH documentation. As far as I read @capote did not disclosed which distro he’s using, so I’ll assume it is Rocky Linux.
3: NS do not manage (ish) the OS! It tampers adding virtual interfaces but the system administration is… rather left to the distro mantainer… and the system admin.
So nothing here is about NS8?
I’ve increaded my VM with NS8 succesfully
Used Claude to a script for me which performed a test first and the step by step the changes.
Thanks guys for the tips !
Excuse me: I use Debian Trixi
Good idea—I had simply asked A0 to resize the image. Now I’ve asked him to write a script for it for me afterward.
Here’s the result für Debian. I haven’t tried it out myself. It’s more of an illustrative example of what A0 comes up with when used in conjunction with DeepSeek v4 Pro.
#!/bin/bash
# resize_sda1.sh
# Resize root partition /dev/sda1 (btrfs) after QCOW2 disk expansion in Proxmox.
# Must be run as root on the NS8 host.
#
# This script will:
# - Save current swap information (UUID, size) and disk label-id
# - Deactivate swap
# - Delete the old extended/swap partitions (sda5, sda2)
# - Compute new partition sizes
# - Rewrite partition table with sfdisk (enlarged sda1 at beginning, new sda2 as swap at end)
# - Resize btrfs online
# - Recreate swap with original UUID
# - Update /etc/fstab if necessary
# - Verify the result
set -euo pipefail
DISK="/dev/sda"
ROOT_PART="${DISK}1"
OLD_SWAP_PART="${DISK}5"
OLD_EXTENDED_PART="${DISK}2"
NEW_SWAP_PART="${DISK}2"
MOUNT_POINT="/"
if [ "$(id -u)" -ne 0 ]; then
echo "ERROR: This script must be run as root."
exit 1
fi
echo "=========================================="
echo "Resize script for /dev/sda1 (btrfs)"
echo "=========================================="
# === 1. Gather current information ===
echo ""
echo "[Step 1] Gathering current disk layout..."
lsblk -f "$DISK"
echo ""
# Ensure the old swap partition exists
if ! blkid "$OLD_SWAP_PART" &>/dev/null; then
echo "ERROR: Old swap partition $OLD_SWAP_PART not found. Is the disk layout as expected?"
exit 1
fi
# Save swap UUID and sector size
SWAP_UUID=$(blkid -s UUID -o value "$OLD_SWAP_PART" || true)
if [ -z "$SWAP_UUID" ]; then
echo "ERROR: Could not retrieve UUID of $OLD_SWAP_PART."
exit 1
fi
echo "Swap UUID: $SWAP_UUID"
SWAP_SECTORS=$(blockdev --getsz "$OLD_SWAP_PART" || true)
if [ -z "$SWAP_SECTORS" ] || [ "$SWAP_SECTORS" -eq 0 ]; then
echo "ERROR: Could not get size of $OLD_SWAP_PART."
exit 1
fi
echo "Swap sectors: $SWAP_SECTORS ($((SWAP_SECTORS * 512 / 1048576)) MiB)"
# Save current disk label-id for sfdisk
LABEL_ID=$(sfdisk -d "$DISK" | grep '^label-id:' | awk -F': ' '{print $2}' | sed 's/,//g' || true)
if [ -z "$LABEL_ID" ]; then
echo "WARNING: Could not detect disk label-id, will use auto-generated."
fi
echo "Disk label-id: $LABEL_ID"
# === 2. Confirmation ===
echo ""
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "WARNING: This script will make irreversible changes to"
echo "$DISK."
echo "Make sure you have a Proxmox snapshot/backup before"
echo "proceeding!"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ""
read -p "Are you ABSOLUTELY sure you want to continue? (yes/no): " CONFIRM
if [ "$CONFIRM" != "yes" ]; then
echo "Aborted."
exit 0
fi
# === 3. Deactivate swap ===
echo ""
echo "[Step 3] Deactivating swap..."
swapoff -a
# === 4. Delete old partitions ===
echo ""
echo "[Step 4] Removing old logical swap partition $OLD_SWAP_PART and extended $OLD_EXTENDED_PART..."
parted -s "$DISK" rm 5 || true # may fail if already removed
parted -s "$DISK" rm 2 || true
# === 5. Compute new sizes ===
echo ""
echo "[Step 5] Computing new partition sizes..."
TOTAL_SECTORS=$(blockdev --getsz "$DISK")
echo "Total sectors: $TOTAL_SECTORS"
END1=$(( TOTAL_SECTORS - SWAP_SECTORS - 1 )) # end sector for sda1
SDA1_SIZE=$(( END1 - 2048 + 1 ))
echo "New sda1 size: $SDA1_SIZE sectors (approx $((SDA1_SIZE * 512 / 1073741824)) GiB)"
SWAP_START=$(( END1 + 1 ))
echo "Swap start: $SWAP_START, size: $SWAP_SECTORS sectors"
# === 6. Rewrite partition table with sfdisk ===
echo ""
echo "[Step 6] Rewriting partition table with sfdisk..."
if [ -n "$LABEL_ID" ]; then
LABEL_LINE="label-id: $LABEL_ID"
else
LABEL_LINE=""
fi
sfdisk --no-reread --force "$DISK" <<EOF
label: dos
$LABEL_LINE
device: $DISK
unit: sectors
${ROOT_PART} : start=2048, size=$SDA1_SIZE, type=83, bootable
${NEW_SWAP_PART} : start=$SWAP_START, size=$SWAP_SECTORS, type=82
EOF
# === 7. Reload partition table ===
echo ""
echo "[Step 7] Reloading partition table..."
partprobe "$DISK" || true
kpartx -u "$DISK" || true
# === 8. Resize btrfs ===
echo ""
echo "[Step 8] Resizing btrfs filesystem online..."
btrfs filesystem resize max "$MOUNT_POINT"
# === 9. Recreate swap ===
echo ""
echo "[Step 9] Creating swap on $NEW_SWAP_PART with UUID $SWAP_UUID..."
mkswap -U "$SWAP_UUID" "$NEW_SWAP_PART"
# === 10. Activate swap ===
echo ""
echo "[Step 10] Activating swap..."
swapon "$NEW_SWAP_PART"
# === 11. Update fstab ===
echo ""
echo "[Step 11] Updating /etc/fstab..."
if grep -q "$OLD_SWAP_PART" /etc/fstab; then
sed -i "s|${OLD_SWAP_PART}|${NEW_SWAP_PART}|g" /etc/fstab
echo "Replaced $OLD_SWAP_PART with $NEW_SWAP_PART in fstab."
else
echo "No reference to $OLD_SWAP_PART found in fstab; skipping."
fi
# === 12. Final verification ===
echo ""
echo "[Step 12] Verification:"
echo "--- df -h $MOUNT_POINT ---"
df -h "$MOUNT_POINT"
echo ""
echo "--- lsblk -f $DISK ---"
lsblk -f "$DISK"
echo ""
echo "--- swapon --show ---"
swapon --show
echo ""
echo "--- btrfs filesystem show $MOUNT_POINT ---"
btrfs filesystem show "$MOUNT_POINT"
echo ""
echo "=========================================="
echo "Script completed. Please review the above output."
echo "=========================================="