News:

RAID is not a replacement for a backup! Here's why.

Main Menu

Linkstation LS220D partition alignment

Started by elmo, October 18, 2023, 12:16:33 AM

Previous topic - Next topic

elmo

I have a LS220D.
I can format a blank drive with it by using current firmware, edit end of current LSUpdater.ini with older LSUpdater.exe as per https://forums.buffalotech.com/index.php?topic=38552.0

I check the results in Linux after formatting an 80GB drive.
The partitioning scheme looks ok as it's non AF drive.

$ sudo fdisk -l

Disk /dev/sdc: 156301488 sectors, 74.5 GiB
Model: 
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID):
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 156301454
Partitions will be aligned on 1-sector boundaries
Total free space is 15676557 sectors (7.5 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34         2000000   976.5 MiB   0700  primary
   2         2000896        11999231   4.8 GiB     0700  primary
   3        11999232        12000000   384.5 KiB   EF02  primary
   4        12000001        12000001   512 bytes   0700  primary
   5        12000002        14000000   976.6 MiB   0700  primary
   6        14000128       140625919   60.4 GiB    0700  primary

$ sudo parted /dev/sdd
GNU Parted 3.3
Using /dev/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                           
Model: WDC WD80 0BEVS-08RST2 (scsi)
Disk /dev/sdd: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
1      17.4kB  1024MB  1024MB  ext3         primary  msftdata
2      1024MB  6144MB  5119MB               primary  msftdata
3      6144MB  6144MB  394kB                primary  bios_grub
4      6144MB  6144MB  512B                 primary  msftdata
5      6144MB  7168MB  1024MB               primary  msftdata
6      7168MB  72.0GB  64.8GB  ext2         primary  msftdata


If I try the same thing but on a 2TB or 3TB drive, I get the same partition scheme except the last partition is larger.

I notice a preformatted 3TB drive that came with a different device, LS-WXL, was aligned ok - it looks like this
$ sudo parted /dev/sda
GNU Parted 3.5
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                           
Model: ATA ST3000DM001-9YN1 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
1      1049kB  1026MB  1024MB  ext3         primary  msftdata
2      1026MB  6146MB  5120MB               primary  msftdata
3      6146MB  6147MB  1049kB               primary  msftdata
4      6147MB  6148MB  1049kB               primary  msftdata
5      6148MB  7172MB  1024MB               primary  msftdata
6      7172MB  2992GB  2985GB               primary  msftdata



So why does the firmware update download / sequence for LS220D not produce an AF aligned drive?
This happens on FW 1.80 and FW 1.78, I don't have older FW download to try it on.
While it is ok for the 80GB, I don't understand why it doesn't align the first 5 partitions properly for an AF drive (2TB or 3TB).
Is it inefficient?
Will there be performance issues for the NAS?
I wonder how many of these devices are running on non aligned AF capable drives!

Edit1: add highlights
Edit2: note this is from -
https://blog.aaronhastings.me/completely-recovering-from-a-bricked-buffalo-linkstation-ls200-series-nas-and-opening-the-firmware-too/
or http://web.archive.org/web/20230127121939/https://blog.aaronhastings.me/completely-recovering-from-a-bricked-buffalo-linkstation-ls200-series-nas-and-opening-the-firmware-too/
Part 1: Wiping the drives
5.Using the parted print command, we can see that there are six partitions on the NAS drive by default:
   (parted) print
    Number  Start   End     Size ...
    1      17.4kB  1024MB  1024MB ...
    2      1024MB  6144MB  5119MB ...
    3      6144MB  6144MB  394kB ...
    4      6144MB  6144MB  512B ...
    5      6144MB  7168MB  1024MB ...
    6      7168MB  2992GB  2985GB ...


So this has been going on for a few years!

elmo

Additional check. So I eventually managed to get the other Linkstation Duo LS-WXL using FW1.75 format a blank 80GB drive and inspect the layout in Linux. This layout looks good for drives of sizes xGB to xTB (I don't know the exact limits).

It verifies fine using gdisk whereas the other one produce by LS220 FW update has warnings in gdisk verify.

$ sudo fdisk  /dev/sdc

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/sdc: 74.54 GiB, 80026361856 bytes, 156301488 sectors
Disk model: 0BEVS-08RST2   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: CF3E408B-1EF5-4F13-B380-96E83534C633

Device        Start       End   Sectors  Size Type
/dev/sdc1      2048   2002943   2000896  977M Microsoft basic data
/dev/sdc2   2002944  12003327  10000384  4.8G Microsoft basic data
/dev/sdc3  12003328  12005375      2048    1M Microsoft basic data
/dev/sdc4  12005376  12007423      2048    1M Microsoft basic data
/dev/sdc5  12007424  14008319   2000896  977M Microsoft basic data
/dev/sdc6  14008320 140633319 126625000 60.4G Microsoft basic data

Command (m for help): q

$ sudo gdisk  /dev/sdc
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdc: 156301488 sectors, 74.5 GiB
Model: 0BEVS-08RST2   
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): CF3E408B-1EF5-4F13-B380-96E83534C633
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 156301454
Partitions will be aligned on 2048-sector boundaries
Total free space is 15670149 sectors (7.5 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         2002943   977.0 MiB   0700  primary
   2         2002944        12003327   4.8 GiB     0700  primary
   3        12003328        12005375   1024.0 KiB  0700  primary
   4        12005376        12007423   1024.0 KiB  0700  primary
   5        12007424        14008319   977.0 MiB   0700  primary
   6        14008320       140633319   60.4 GiB    0700  primary

Command (? for help): v

No problems found. 15670149 free sectors (7.5 GiB) available in 2
segments, the largest of which is 15668135 (7.5 GiB) in size.

Command (? for help): q

$ sudo parted   /dev/sdc
GNU Parted 3.3
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                           
Model: WDC WD80 0BEVS-08RST2 (scsi)
Disk /dev/sdc: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
1      1049kB  1026MB  1024MB  ext3         primary  msftdata
2      1026MB  6146MB  5120MB               primary  msftdata
3      6146MB  6147MB  1049kB               primary  msftdata
4      6147MB  6148MB  1049kB               primary  msftdata
5      6148MB  7172MB  1024MB               primary  msftdata
6      7172MB  72.0GB  64.8GB               primary  msftdata

(parted) q                       
 


So it looks like the FW update for LS200 produces a partition layout that is not optimum for AF drives.

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 5: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default), StopForumSpam.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 169 (show)
Files included: 35 - 1354KB. (show)
Memory used: 974KB.
Tokens: post-login.
Queries used: 16.

[Show Queries]