Author Topic: SSD partition miss aligned.  (Read 2158 times)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3627
  • Karma: +77/-0
    • View Profile
Re: SSD partition miss aligned.
« Reply #15 on: February 04, 2022, 07:58:54 pm »
BTW: IIRC, you need sysinstx only when the filesystem has changed. (Not really sure, if this is correct.)

Yes, I've moved partitions many a time with xcopy like Remy did and only once did I need sysinstx that I remember. FAT, I believe always needs it and otherwise it is needed to insert the right os2ldr or os2boot, forget which.

Remy

  • Hero Member
  • *****
  • Posts: 510
  • Karma: +8/-1
    • View Profile
Re: SSD partition miss aligned.
« Reply #16 on: February 04, 2022, 10:26:40 pm »
BTW: IIRC, you need sysinstx only when the filesystem has changed. (Not really sure, if this is correct.)

Yes, this should be the case but I've got one time partition not booting and after sysinstx it was ok.
After this error, I issued it after each time I recovered a bootable partition (it is quick to do) and seems not to provide a problems.

I have to correct my latest update about partition aligment !

Finally partition aren't aligned (I used an other calculator but this one rounded results making me think been aligned)
and It seems not possible with ArcaOS to have them aligned on SSD using default driver settings

(I checked under linux using fdisk always providing unaligned partition messages but linux is now able to mount 2 partitions of the 3). I check partition from my older SSD (a 240GB) and first partition was at the same offset  :(  x'7F' not good start offset (If you check your SSD under DFSEE and found under it that first one is at offset x'7F' then, it isn't aligned...     

Here is the SSD layout seen under windows7 (msinfo32)
Should AHCI be started with a specific parameter to force use of aligned partition on SSD, I'll check this next...
But first, I have to find out on which adapter this disk is connected to...

(As known, not aligned partition on SSD will increase write operation and this reduces SSD ifetime which is given on a number of write operation)
« Last Edit: February 05, 2022, 02:05:34 am by Remy »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3627
  • Karma: +77/-0
    • View Profile
Re: SSD partition miss aligned.
« Reply #17 on: February 04, 2022, 11:04:53 pm »
Just looked at https://www.arcanoae.com/wiki/ahci/ which talks about the various alignment bugs.
Forget the equivalent to COPY IBMS506$ con: for AHCI, could always run testlog.

Remy

  • Hero Member
  • *****
  • Posts: 510
  • Karma: +8/-1
    • View Profile
Re: SSD partition miss aligned.
« Reply #18 on: February 05, 2022, 02:16:30 am »
Just looked at https://www.arcanoae.com/wiki/ahci/ which talks about the various alignment bugs.
Forget the equivalent to COPY IBMS506$ con: for AHCI, could always run testlog.

I have ArcaOS 5.0.7 (the latest and of course, the latest AHCI. Alignment is not correct for SSD (it is for HDD)
I didn't test the 56 sectors to check its result. I did a test adding the adapter, port and /4 on the SSD disk and boot it.
This flag has no incident during the boot.
Will it allow correct alignment when creating volumes under LVM ? I don't know !

(Why don't they use same tricks as used by some users, add an offset of 1MB at beginning of the disk  ::) )

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3627
  • Karma: +77/-0
    • View Profile
Re: SSD partition miss aligned.
« Reply #19 on: February 05, 2022, 08:05:55 am »
Perhaps open an issue?

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1129
  • Karma: +24/-0
    • View Profile
Re: SSD partition miss aligned.
« Reply #20 on: February 05, 2022, 04:54:29 pm »
Remy, everyone...

It's the usual problem, need to do all partitioning with OS/2 aware tools, and do some math to have the 4k sector partitioning, basically JFS 4k sectors need to align with the SSD's 4k sectors...
...
Before, I had H255 and S63  (of course, sector size always left at default 512...)
But this resulted to unaligned partition while Dfsee found it aligned (ok for HDD) but it isn't for SSD.
...

Dave brought up an important point, at least from a performance perspective: the alignment of hardware and software implementation.

So 4k sector size for SSD, and unless you MUST pick something different from JFS IFS perspective, you would want the same matching 4k JFS blocksize (see format's /BS parameter).

The HELP page for our format specifically states:

Quote
...The block size specified must not be smaller than the sector size of the device....

...however what I do not know (having never tried it myself) is what would happen if you do try a JFS blocksize <4K?

Anyways, re: the above sync, my expectation would be that this would assure a minimal overhead for all processing.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3627
  • Karma: +77/-0
    • View Profile
Re: SSD partition miss aligned.
« Reply #21 on: February 05, 2022, 06:38:34 pm »
I experimented with small block sizes years back. Mostly found that performance decreased with a smaller block size, which from what I read was expected unless you deal with mostly small files. Also lose Linux compatibility as they never bothered to implement small blocks.
Another option for small block size is HPFS, which uses 512k sectors with a minimum file size or 2 sectors. Also get away from the journal and all the wear that puts on the SSD.
Linux also allows disabling atime (access time) which updates the files timestamp when simply looking at a file causing a slight performance hit and more writing. Use the properties notebook-->files to see the various times or use stat,
Code: [Select]
W:\>stat config.sys
  File: config.sys
  Size: 8739            Blocks: 18         IO Block: 49152  regular file
Device: 5657h/22103d    Inode: 14964592257604998832  Links: 1
Access: (0666/-rw-rw-rw-)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-02-05 08:49:48.000000000 -0800
Modify: 2022-01-30 09:21:24.000000000 -0800
Change: 2022-01-30 09:21:24.000000000 -0800
 Birth: 2022-01-30 09:21:24.000000000 -0800

Shows I looked at config.sys on the 5th.

Remy

  • Hero Member
  • *****
  • Posts: 510
  • Karma: +8/-1
    • View Profile
Re: SSD partition miss aligned.
« Reply #22 on: February 05, 2022, 10:11:34 pm »
My last test:
I used my older and smaller SSD (240GiB)
- Added 3 partitions fat32 no name no letter under windows (first one was created with a 1MiB start offset  (ok, aligned))

Now booted into ArcaOS with AHCI /A:0 /P:1 /4   this SSD been at this adapter / port number  (/4 to use 56 sectors as it is written)
I could see my disk under DFSEE and the 1MiB free offet before the first partition
I opened LVM, LVM could see it with the good size value
I tried to set names and letter but LVM replied unable to update the disk ...  (The disk is seen under LVM but in fact unusable from under LVM)
Like this, partitions unusable
I deleted partition and created them using LVM (simple), partitions where created.
I check under DFSEE and none are aligned (system CCC 255 63 and logical CCC 64 32)
From my test, I do not understand what /4 parameter on AHCI  is realy supposed to do.
In all cases I tested, i never could have aligned partition on SSD usable by ArcaOS and airboot requires 63 sectors to allow its installation.

From my point of view, this is major issue to be resolved because it has lifetime issue on SSD which are more and more used in replacement of HDD.
(New SSD have a big write possibilities but when you do many write operation a day [several GiB], it is good to preserve its lifetime with correct SSD usage - and been use it correclty under linux for fstrim is welcome too to gain speed again when it drop down)

If someone is able to find the solution to correct this, I'm interested

Regards
Rémy         
« Last Edit: February 05, 2022, 10:17:55 pm by Remy »