I'm running a StartOS on Oracle VM on a 2TB SSD but I only allocated 1TB initially

Now I want to increase the allocation from 1TB to 1.8 TB or so to forget about it, I’m currently doing a node sync, its 50% done, I really really don’t want to lost the progress, is there any way I can do this without losing the progress or ruining everything and start over?

I have windows 10 and am using an External 2TB SSD

Is the 1 TB virtual disk also on the external SSD, or are you moving it over there before expanding it?

Are you able to locate the virtual disk (on the external SSD drive if you are not moving it)? It should be named something like [VM Name].vdi and may be in a subfolder named like [VM Name] (where “[VM Name]” is whatever you called the VM when you created it). If you can give my the exact path and filename for the .vdi file, I’ll taylor the commands so you can just copy/ paste them.

2 Likes

The 1TB is the same 2TB external SSD, I only allocated 1TB of it’s space because I though I won’t need more than that for at least 1 year from now, but I think I was wrong.

Here is the exact path for the .vdi:

“F:\Start9\Start9.vdi”

Perfect. Also, are you running StartOS version 0.3.5.1, or version 0.4.0?

1 Like

I’m running StartOS version 0.3.5.1

Perfect. And what is the name of your server (something like “adjective-noun.local”)?

1 Like

Yes, Its https://sandy-factoid.local/

Ok, I had my LLM help me format this into a user-friendly guide. I ran through this on a quick test server just now to verify it, but let me know if something doesn’t go as expected (I ran it on Windows 11, for example, so something might be different with Windows 10)

Increasing Your StartOS Data Disk in VirtualBox (1 TB → 1.8 TB)

This guide walks you through making your StartOS virtual disk bigger without losing any of your data. You will grow the VirtualBox disk file from 1 TB to 1.8 TB, then tell StartOS to use the new space.

There are three parts:

  1. Enlarge the virtual disk (done in Windows, with the StartOS machine shut down).
  2. Connect to StartOS (a one-time setup so you can type a command into it).
  3. Expand the storage inside StartOS (one copy-and-paste command).

It takes about 20–30 minutes. Take your time and do the parts in order.

This exact procedure was tested end-to-end on a StartOS 0.3.5.1 VirtualBox machine before
being written down. The data was verified byte-for-byte identical before and after, and the
machine was rebooted to confirm the change sticks.


:warning: Before you start — please read

  • Back up first. Even though this is designed to be safe, it is HIGHLY RECOMMENDED to backup before changing a disk. However, a backup would require another drive with enough space. See Step 0 below.
  • Do the steps in order. Part 1 must be finished (and the machine restarted) before you run the command in Part 3.
  • No snapshots. If you ever created “Snapshots” of this VirtualBox machine, the resize in Part 1 can fail or resize the wrong file. If you have snapshots, delete them first (in VirtualBox:
    select the machine → Snapshots → delete), or ask for help before continuing.

Step 0 — Make a backup

The simplest safety net is to make a copy of the disk file while StartOS is shut down.

  1. Stop all services in StartOS (including Knots) before proceeding
  2. Shut down StartOS properly: open the StartOS web page, go to System → Restart/Shutdown and choose Shutdown (or, in the VirtualBox window, use Machine → ACPI Shutdown). Wait until the machine is fully powered off.
  3. In Windows, open the F:\Start9 folder.
  4. Copy Start9.vdi to another location that has enough free space (for example another external drive), and keep it until you have confirmed everything works. This copy is your “undo button” — if anything goes wrong, you can copy it back.

Part 1 — Enlarge the virtual disk (StartOS shut down)

Make sure all services have been stopped and the StartOS machine is fully powered off (from Step 0).

Do this:

  1. Press the Windows key, type cmd, and open Command Prompt.

  2. Copy the line below, paste it into the Command Prompt window (right-click to paste), and press Enter:

    "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifymedium disk "F:\Start9\Start9.vdi" --resize 1887437
    
    

    You’ll see a progress bar go from 0%... to 100%. That’s it — the disk file is now 1.8 TB.

    What is 1887437? It’s the new size in megabytes, which is about 1.8 TB the way
    VirtualBox measures it. If you want a different size, change that number (1024 MB = 1 GB).

Prefer clicking instead of typing? (optional alternative)

You can do the same thing with the mouse:

  1. Open VirtualBox.
  2. Menu File → Tools → Virtual Media Manager.
  3. Click the Start9.vdi disk in the list.
  4. At the bottom, find the Size box, set it to 1.80 TB, and click Apply.

Either method is fine — you only need to do one.


Part 2 — Connect to StartOS (one-time setup)

To finish, you’ll type one command inside StartOS. You reach it using a tool called SSH, which is already built into Windows 10. This section sets that up. You only ever do this once.

2a. Start StartOS back up

In VirtualBox, select the Start9 machine and click Start. Wait 1–2 minutes until you can
open the StartOS web page as usual.

2b. Create your SSH key (in Windows)

  1. Open Command Prompt again (Windows key → cmd).

  2. Paste this and press Enter:

    ssh-keygen -t ed25519 -f %USERPROFILE%\.ssh\startos_key -N ""
    
    

    This creates two small files in your account. (If it asks to overwrite, you can type y.)

  3. Now show your new public key so you can copy it. Paste this and press Enter:

    type %USERPROFILE%\.ssh\startos_key.pub
    
    

    It prints one line that starts with ssh-ed25519 .... Select that whole line and copy it
    (highlight it, then press Enter or right-click to copy).

2c. Add the key to StartOS

  1. Open the StartOS web page in your browser and log in.
  2. Go to System → SSH (it may be listed as SSH Keys).
  3. Click Add Key (or the + button), paste the line you copied, and save.

2d. Your StartOS address

StartOS has a local network name that ends in .local. Yours is:

sandy-factoid.local

Your SSH address is that name with start9@ in front:

start9@sandy-factoid.local

You’ll use this in the next step and in Part 3.

2e. Test the connection

In Command Prompt, paste this and press Enter:

ssh -i %USERPROFILE%\.ssh\startos_key start9@sandy-factoid.local

The first time, it will ask “Are you sure you want to continue connecting?” — type yes and
press Enter. When you see a StartOS welcome banner and a prompt like start9@... $, you’re in. :tada:

To leave StartOS at any time, type exit and press Enter.


Part 3 — Expand the storage inside StartOS

Make sure you have finished Part 1 (the disk is now 1.8 TB) and you are connected to StartOS
(you see the start9@... $ prompt from Step 2e).

Do this:

Copy the entire block below — all of it, from bash to SCRIPT — paste it into the StartOS
window, and press Enter:

bash <<'SCRIPT'
set -e
echo "[1/6] Growing the partition to fill the disk..."
echo ",+" | sudo sfdisk --no-reread -f -N 4 /dev/sda
echo "[2/6] Refreshing the partition table..."
sudo partx -u /dev/sda
echo "[3/6] Growing the storage pool..."
sudo pvresize /dev/sda4
echo "[4/6] Growing the data volume..."
VG=$(sudo vgs --noheadings -o vg_name | tr -d ' ')
sudo lvextend -l +100%FREE "/dev/$VG/package-data"
echo "[5/6] Growing the encryption layer..."
NAME=$(basename "$(findmnt -n -o SOURCE /embassy-data/package-data)")
printf 'password' | sudo cryptsetup resize "$NAME"
echo "[6/6] Growing the filesystem..."
sudo btrfs filesystem resize max /embassy-data/package-data
echo ""
echo "SUCCESS -- new data-drive size:"
df -h /embassy-data/package-data | tail -1
SCRIPT

It runs six quick steps and prints progress. When it finishes you’ll see:

SUCCESS -- new data-drive size:
/dev/mapper/EMBASSY_..._package-data  btrfs  1.8T  ...  1.8T   1% /embassy-data/package-data

That’s it — your StartOS storage is now 1.8 TB. :tada:

Note: The line that says Re-reading the partition table failed ... Device or resource busy
is normal and expected — the very next step handles it. As long as the last line says
SUCCESS, you’re done.


Finish up

  1. In StartOS (the web page), do a normal Restart to confirm everything is healthy.
  2. After it comes back, check System → About / Storage in StartOS — it should now show the larger capacity.
  3. Start the services back up in order (starting with Knots) and confirm they are working
  4. Once you’ve confirmed your services are all fine, you can delete the backup copy of
    Start9.vdi you made in Step 0.

Troubleshooting

The command stops at step [5/6] with “No key available with this passphrase.”
The data drive’s built-in password on StartOS 0.3.5.x is the word password (that’s what the
command uses automatically). If your setup is different, this step will stop safely without
changing anything
— nothing is harmed. Reach out for help before retrying.

Part 1 command says the medium is “locked” or in use.
StartOS wasn’t fully shut down. Shut it down completely (machine powered off in VirtualBox), then run the Part 1 command again.

Part 1 mentions snapshots, or resizes but StartOS still shows the old size.
You likely have VirtualBox snapshots. Delete them (VirtualBox → select machine → Snapshots), then redo Part 1.

ssh says “Could not resolve hostname.”
Your PC can’t find the .local name. Make sure the StartOS machine is running and on the same network. In VirtualBox the machine should use Bridged networking (this is how the standard StartOS VirtualBox setup is configured). If you can open the StartOS .local web page from your PC, SSH will work too.

The expansion command shows an error about “0 extents” or “no space”.
This usually means Part 1 wasn’t finished (the disk wasn’t actually enlarged, or StartOS wasn’t
restarted after Part 1). Confirm the disk is 1.8 TB, restart StartOS, and run the block again.
Running the block a second time after a successful run is harmless — it just reports there’s nothing
left to grow.


Appendix — What the expansion command actually does (for the curious)

StartOS stores your app data through several stacked layers. Each layer has to be grown in turn,
from the outside in:

Step Layer What happens
1 Partition (sda4) The last partition is stretched to fill the now-larger disk.
2 Kernel refresh Linux is told about the new partition size without a reboot.
3 LVM pool The storage pool recognizes the extra space.
4 Data volume The package-data volume claims all the new free space.
5 Encryption (LUKS) The encrypted layer is grown to match.
6 Filesystem (btrfs) The filesystem finally expands to fill everything.

The command figures out your machine’s unique volume names automatically, so the same block works on any StartOS 0.3.5.x machine — you don’t need to edit anything.

Nothing is ever deleted or reformatted; every layer is only grown, which is why your existing data is preserved.

1 Like

Worked beautifully, thank you so much,@paul :heart:

1 Like