Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop

In this Discussion

New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Do you format hard drives with 4096-byte sectors?

When you provision a new server, do you format the hard drives with 4K sectors, or do you leave them at 512 bytes?

For example, OVH always gives me servers with hard drives set to 512 bytes even though they support 4K. I wonder why that is — is it a compatibility issue?

Thanked by 2oloke forest

Comments

  • forestforest Member

    Yes, it's a compatibility issue. 4k sectors do not support MBR or legacy boot, which assumes a 512 byte boot sector. OVH just figures that a small opt-out performance penalty is better than the occasional user screaming that he's been ripped off because he can't boot into an MBR system.

    For a VPS, I imagine there's no real way to know what the underlying physical disk uses, nor how the host has configured its system. 4k may be better in some situations but worse in others. In the case of a VPS, I only set 4k sectors for encrypted swap with something like this in my crypttab so it matches the page size:

    swap /swapfile /dev/random swap,cipher=aes-cbc-essiv:sha256,size=256,sector-size=4096
    
    Thanked by 1Akira3
  • Akira3Akira3 Member

    @forest said:
    Yes, it's a compatibility issue. 4k sectors do not support MBR or legacy boot, which assumes a 512 byte boot sector. OVH just figures that a small opt-out performance penalty is better than the occasional user screaming that he's been ripped off because he can't boot into an MBR system.

    For a VPS, I imagine there's no real way to know what the underlying physical disk uses, nor how the host has configured its system. 4k may be better in some situations but worse in others. In the case of a VPS, I only set 4k sectors for encrypted swap with something like this in my crypttab so it matches the page size:

    swap /swapfile /dev/random swap,cipher=aes-cbc-essiv:sha256,size=256,sector-size=4096
    

    At OVH, I was able to switch the secondary drives to 4K, and everything seems to be working fine.

    However, when I tried to do the same on the primary drive (from rescue boot) and then rebooted to install the OS from the OVH template, it failed — the installation didn’t work and gave an error. I’m afraid you’re right that OVH has their system configured for 512-byte sectors on the initial/boot disk.

  • forestforest Member

    Instead of using the template, connect with VNC (if a VPS) or IPMI (if a dedicated server) and install the OS directly from the installation medium. Most Debian-based templates do not even use UEFI, which is necessary to have your root on a 4k drive.

    Thanked by 1Akira3
Sign In or Register to comment.