Forum Moderators: bakedjake

Message Too Old, No Replies

Moved Server Image to VPS, Works but Cannot Make Use of Full Disk

[Linux] - What was a partition is now mounted as the whole disk.

         

diddly

11:25 pm on Feb 10, 2023 (gmt 0)

10+ Year Member



Hello,
I'm sorry if the title is a little wobbly.
More detail:
I ran my own Debian server on my own machine from home.
I now moved the server to a VPS "root server" by

  • creating an offline image of the root partition containing the OS, with dd (iirc I used the extension .raw)
  • uploading that image to the new provider through their web interface
  • booting from it

Surprisingly, this worked immediately, and I thought nothing more of it, until I decided to make use of the full disk - the partition image is only 8GB, I have 80GB. This also shows up in utilities like fdisk or df, however - It shows me that the partiion is mounted as /dev/sda, NOT /dev/sda1.

The problem

I can create a new partition with parted, but whenever I try to create a filesystem in it I get
mkfs: /dev/sda1 is apparently in use by the system; will not make a filesystem here.
Very similar with
cryptsetup luksFormat /dev/sda1: Cannot use device /dev/sda1 which is in use (already mapped or mounted).

How can I create a new partiion to utilise all the storage I'm paying for? Can I change the current system in a way that it "turns into" a normal partition? I could do that with an offline snapshot, but I would prefer to solve it without having to upload a full snapshot. Reboots are cheap, however. GRUB is installed.

Or am I misunderstanding the problem?

diddly

1:06 am on Feb 18, 2023 (gmt 0)

10+ Year Member



No easy solution, but fortunately my ISP provides an option to boot a Live rescue system (I found out).
I had to create a larger, encrypted partition on the whole disk, wiping everything on it.
Then I had to "manually" copy the whole system from a mounted snapshot with rsync/ssh.
All good now, but a few symlinks got lost (probably because of my poor grasp on rsync).

Dimitri

10:24 am on Feb 18, 2023 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Surprisingly, this worked immediately,

This is lucky, sine your home server, and the VPS are not featuring the same configurations.

A good practice is to install a fresh system on your VPS, then to copy your /home (or wherever you have your data) from your home server to the VPS, using ssh + rsync for example.