[Weiter unten auch auf deutsch] - Moved Server Image to VPS, Works but Cannot Make Use of Full Disk - What was a partition is now mounted as the whole disk.

  • 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 through the SCP
    • 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?


    ===============================================================


    Hallo,

    Tut mir leid dass der Titel etwas wackelig ist.

    Mehr Details:

    Ich habe meinen eigenen Debian-Server auf meinem eigenen Rechner von zu Hause aus betrieben.

    Ich habe den Server jetzt auf einen Root Server VPS umgezogen:


    • Erstellen eines Offline-Images der Root-Partition, die das Betriebssystem enthält, mit dd (ich glaube ich habe die Erweiterung .raw verwendet)
    • Hochladen dieses Bildes über das SCP
    • davon booten


    Überraschenderweise hat das sofort funktioniert, und ich habe mir nichts weiter dabei gedacht, bis ich mich entschied, die volle Festplatte zu nutzen - das Partitionsabbild ist nur 8 GB groß, ich habe 80 GB. Dies wird auch in fdisk oder df angezeigt - aber es zeigt mir auch dass die Partition als /dev/sda gemountet ist, NICHT als /dev/sda1.


    Das Problem


    Ich kann mit parted eine neue Partition erstellen, aber wenn ich versuche, ein Dateisystem darin zu erstellen, bekomme ich

    mkfs: /dev/sda1 is apparently in use by the system; will not make a filesystem here.

    Ähnlich auch mit

    cryptsetup luksFormat /dev/sda1: Cannot use device /dev/sda1 which is in use (already mapped or mounted).


    Wie kann ich eine neue Partition erstellen, um den gesamten Speicherplatz zu nutzen für den ich bezahle? Kann ich das aktuelle System so ändern, dass es sich in eine normale Partition „verwandelt“? Ich könnte das mit einem Offline-Snapshot machen, aber ich würde es vorziehen, es zu lösen, ohne einen vollständigen Snapshot hochladen zu müssen. Neustarts sind jedoch billig. GRUB ist installiert.


    Oder verstehe ich das Problem doch falsch?

  • You can go to the SCP and put the "GParted Live CD 1.3.0" DVD into the DVD drive. Then you change the boot priority to the DVD-ROM and boot from it. Now your partition is not mounted and you can increase your existing partition or create additional partitions.


    Also, /dev/sda is probably the raw device and not a partition like /dev/sda1.

  • Hallo. :)

    Also, /dev/sda is probably the raw device and not a partition like /dev/sda1.

    Das wird er schon verstanden haben.

    Erstellen eines Offline-Images der Root-Partition

    Hier wurde ein Abbild des Inhalts der Partition erstellt. Das SCP erwartet aber wohl ein Abbild des gesamten Datenträgers. Er sitzt nun also vor einer virtuellen Platte ohne MBR/GPT/Partitionierungstabelle. Hier kann keine Partition erweitert werden, weil es keine gibt.



    Anstatt die (nicht existierende) Partitionierung bearbeiten zu wollen, könnte man jetzt wohl schon direkt das Dateisystem erweitern. Dessen Grenzen nun nur noch die Sektoren/Blöcke des kompletten Datenträgers darstellen.

    Wie sauber das ganze aber für einen Produktivbetrieb sein wird, will ich nicht beurteilen. Und vor allem, wie das Ding überhaupt ohne MBR oder EFI-Partition überhaupt booten konnte.

    Web Expert M

    Root-Server M SATA v6

    RS 1000 SAS G7SEa3

    RS 1000 SAS G8 a1

  • Well, you can use resize2fs /dev/sda and call it a day.


    However, since you have already written a new partition table into the partition itself - I would declare the system as unstable.

    I would boot the VPS into the rescue system, also boot an ISO on your source system, create a partition table and


    dd if=/dev/sda1 bs=4M status=progress | ssh root@VPS "dd of=/dev/sda1 bs=4M" on your source system. (It's only 8 GiB).

    If your connection is that slow, you can compress the stream on the way.

  • Dank an alle erstmal!

    You can go to the SCP and put the "GParted Live CD 1.3.0" DVD into the DVD drive. Then you change the boot priority to the DVD-ROM and boot from it. Now your partition is not mounted and you can increase your existing partition or create additional partitions.

    Super Tipp. War mir gar nicht klar dass das möglich ist.


    Da ich gleichzeitig Verschlüsseln möchte werde ich wohl mehr als diese eine Nicht-Partition brauchen.


    Ich schätze es ist nicht möglich die jetzige Situation umzuwandeln ohne das System von einem Backup wieder zu installieren?


    Ich frage mich jetzt wie ich das machen könnte.

    Folgendes Szenario habe ich mir ausgemalt:


    - GParted Live booten

    - Die gesamten 80GB partitionieren (/boot, und den Rest verschlüsselt). Was das derzeitige BS vernichtet

    - Auf Gparted einen SSH Daemon starten

    - Backup daheim lokal einbinden (mounten)

    - Entsprechende Daten mit rsync in die entsprechenden Partitionen kopieren (sftp oder scp)

    - Auf dem Server in z.B. /etc/fstab UUIDs anpassen, GRUB editieren usw. (Tutorial aus ArchWiki)


    Kann man das einfacher machen?


    =================================================================


    Great tip. I wasn't even aware that this was possible.


    Since I want to encrypt at the same time I will probably need more than this one non-partition.


    I guess it's not possible to convert the current situation without reinstalling the system from a backup?


    I'm wondering now how I could do that.


    I imagined the following scenario:


    - Boot GParted Live

    - Partition the entire 80GB (\boot, and encrypt the rest). What the current BS destroys

    - Start an SSH daemon on Gparted

    - Mount backup locally at home

    - Copy corresponding data with rsync into the corresponding partitions (sftp or scp)

    - Adjust UUIDs on the server in e.g./\etc/fstab, edit GRUB etc. (Tutorial from ArchWiki)

  • Ich hab vorher den Beitrag von H6G nicht aufmerksam gelesen.


    Ich habe jetzt sowohl GParted als auch das Rettungssystem gebooted, es ist mir aber auch nach starten des ssh servers nicht gelungen über ssh reinzukommen (hab auch die Konfiguration bearbeitet um sicherzustellen dass sowohl Passwörter als auch root login erlaubt sind). Entweder es hängt komplett oder es nimmt das Passwort nicht an: "Permission denied, please try again."

    Ich habe versucht sowohl die vom SCP bereitgestellten Rootpasswörter zu benutzen, als auch mit "passwd root" ein neues zu erstellen.


    Mein installierter Server hat dieses Problem nicht.


    =====================================================


    I didn't read H6G's post carefully, before.


    I now booted both GParted and the rescue system, but couldn't get in via ssh even after starting the ssh server (also edited the config to make sure both passwords and root login are allowed). Either it hangs completely or it doesn't accept the password: "Permission denied, please try again."

    I've tried both using the root passwords provided by the SCP and creating a new one with "passwd root".


    My installed server does not have this problem.

  • Either it hangs completely

    If you have configured both IPv4 and IPv6 you should connect to the rescue system via ssh root@IPv4 or ssh -4 root@VPS.

    You could also increase the verbosity with the -v parameter and check the ssh daemon log.


    Also check the keyboard layout, maybe just type the password in a text editor on the SCP screen, to check if what you type is actually what is received by the server.


    Also, can we stick to one language, please?

  • Yes, of course. I guess English is OK.


    I got into the rescue system (grml) after


    - starting the ssh.service

    - changing the root password


    I'm not sure what the root passwords in SCP's rescue disk tab are there for; they clearly did not work in this situation. (I used ssh -vvv, everything worked until the end when it refused the connection after entering the password). And they are just plain old ASCII.


    I guess I'll start with partitioning the disk now, and hopefully I can install the system as envisioned.

  • Ich denke Deutsche, bzw Deutschsprachige sollten sich in einem deutschen Forum auch auf Deutsch unterhalten...

    Sieht für mich nach automatischer Übersetzung aus z.B. wackliger Titel - schreibt man im Deutschen eigentlich nicht.

    Gehe mal davon aus das die Person Englisch kann und auf Deutsch übersetzt hat, weil es ein Deutsches Forum ist - was aber hier relativ unnötig ist