Skip to main content
Clean the disks

Clean the disks

If there is data from previous OS installations on the disks, perform a full manual disk cleanup.

  1. Boot the server in Rescue mode.
  2. Clean the disks.
  3. Change the upload template.

1. Boot the server in Rescue mode

  1. in control panels from the top menu, press Products and select Dedicated servers.
  2. In the section Servers open the server page → tab Operating system.
  3. Click Change the upload template.
  4. In the field Upload template select Boot to Rescue.
  5. Click Save and reboot. The server will be rebooted.

2. Clean the disks

  1. Connect to the server via SSH or through KVM console.

  2. Display information about the disks:

    lsblk

    Example output:

    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
    sda 8:0 0 1.8T 0 disk
    └─sda1 8:1 0 1.8T 0 part /mnt/data
    sdb 8:16 0 931.5G 0 disk
    └─sdb1 8:17 0 931.5G 0 part /mnt/backup
    nvme0n1 259:0 0 465.8G 0 disk
    ├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
    ├─nvme0n1p2 259:2 0 16G 0 part [SWAP]
    └─nvme0n1p3 259:3 0 449.3G 0 part /

    Here. sda, sdb, nvme0n1 — disk IDs.

  3. Copy the disk IDs you obtained in step 2.

  4. Clear the partitions on each disk:

    fdisk /dev/<disk_id>

    Specify <disk_id> — ID of the disk you copied in step 3.

    If there are multiple partitions on the disk, enter duntil all partitions have been deleted.

  5. Save your changes:

    w
  6. Clear the file system signatures on each disk:

    wipefs -fa /dev/<disk_id>

    Specify <disk_id> — ID of the disk you copied in step 3.

  7. Optional: perform a deep clean of each disk:

    dd bs=512 if=/dev/zero of=/dev/<disk_id> count=2048 seek=$(('blockdev --getsz /dev/<disk_id>' - 2048))

    Specify <disk_id> — ID of the disk you copied in step 3.

3. modify the upload template

Bring back the old server loading template or reboot the server from the OS. When you reboot the server from the OS, the boot template will automatically change to the one that was set before server booting in Rescue mode.