Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Disk alignment warning

Featured Replies

Running version 6.4.0_rc14.

 

When adding a new disk to the array during the format process I saw the following in the log about partition alignment (the disk is an older 3TB Seagate AF disk):

 

Nov 24 10:25:41 Tower kernel: sdo: sdo1
Nov 24 10:25:41 Tower emhttpd: shcmd (690): sgdisk -o -a 1 -n 1:32K:0 /dev/sdo
Nov 24 10:25:42 Tower root: Creating new GPT entries.
Nov 24 10:25:42 Tower root: Warning: Setting alignment to a value that does not match the disk's
Nov 24 10:25:42 Tower root: physical block size! Performance degradation may result!
Nov 24 10:25:42 Tower root: Physical block size = 4096
Nov 24 10:25:42 Tower root: Logical block size = 512
Nov 24 10:25:42 Tower root: Optimal alignment = 8 or multiples thereof.
Nov 24 10:25:42 Tower root: The operation has completed successfully.
Nov 24 10:25:42 Tower emhttpd: shcmd (691): udevadm settle
Nov 24 10:25:42 Tower kernel: sdo: sdo1

 

Is this expected behavior?  I'm concerned about the "Performance degradation may result!" bit.

The sgdisk command was changed on rc8 probably because of the added 4kn support, and since then you'll see that warning, but the partition still starts on sector 64, so it's aligned, no worries.

 

 

2 hours ago, johnnie.black said:

The sgdisk command was changed on rc8 probably because of the added 4kn support, and since then you'll see that warning, but the partition still starts on sector 64, so it's aligned, no worries.

 

 

 

Correct.

 

In earlier version of 'sgdisk' its relevant code looks like this:

// Set partition alignment value; partitions will begin on multiples of
// the specified value
void GPTData::SetAlignment(uint32_t n) {
   if (n > 0)
      sectorAlignment = n;
   else
      cerr << "Attempt to set partition alignment to 0!\n";
} // GPTData::SetAlignment()

 

In current version of 'sgdisk' it looks like this:

// Set partition alignment value; partitions will begin on multiples of
// the specified value
void GPTData::SetAlignment(uint32_t n) {
   if (n > 0) {
      sectorAlignment = n;
      if ((physBlockSize > 0) && (n % (physBlockSize / blockSize) != 0)) {
         cout << "Warning: Setting alignment to a value that does not match the disk's\n"
              << "physical block size! Performance degradation may result!\n"
              << "Physical block size = " << physBlockSize << "\n"
              << "Logical block size = " << blockSize << "\n"
              << "Optimal alignment = " << physBlockSize / blockSize << " or multiples thereof.\n";
      } // if
   } else {
      cerr << "Attempt to set partition alignment to 0!\n";
   } // if/else
} // GPTData::SetAlignment()

 

Elsewhere in the code it checks that a partition start sector is a multiple of the physBlockSize (which it is whether 512 or 4096).

 

Our 'sgdisk' command looks like this:

sgdisk -o -a 1 -n1:32K:0 <device>

We set sectorAlignment to 1 in order to override 'sgdisk' default of 2048 which puts partition 1 starting at 1M from start of disk instead of 32K from start like we want it.  In both versions of the code this works ok, but in newer 'sgdisk' that MOD operator always returns 1 if n==1, thus the warning.  I think we can change our 'sgdisk' command to this and quiet the message:

sgdisk -o -a 8 -n1:32K:0 <device>

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.