Score:0

Possible to correct the alignment of partition without data loss?

cn flag

Somehow I managed to install a server with misaligned partitions.
fdisk says:

Device     Boot      Start        End    Sectors  Size Id Type
/dev/xvda1               2 2095151103 2095149056  999G 83 Linux
/dev/xvda2      2095153150 2097149951    1996802  975M  5 Extended
/dev/xvda5      2095153152 2097149951    1996800  975M 82 Linux swap / Solaris

Consequences:

  • my partitions are misaligned so I fear the performance penalties
  • grub has no place to be installed (I realized this problem on the last update, where I saw the error message)

My question:
Can I somehow repair this without loosing data?
(my system is installed and configured and some software installed, I would loose like 3 days of work if I had to reinstall)

My system:

  • Debian 11
  • running as a vServer at my hosting provider
  • no LVM or raid

I already searched for solutions. Basically I would have to move the whole partition to the right, correct?? (with a 1TB disk, I have more than enough disk space for such experiments). Looks like fdisk cant do that. Some people say gparted, but I have no GUI on the system, some say parted, but others say the 'move' option was removed from newer parted versions. Maybe sfdisk?

Any help would be appreciated, or just say I must reinstall, so I dont waste even more time. Thanks

archygriswald avatar
cn flag
sfdisk has the --move-data option, looks like this will do what I need [sfdisk manpage](https://man7.org/linux/man-pages/man8/sfdisk.8.html)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.