Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £99! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £149! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

[SF8008] Small issue with fstrim on my internal SSD - It doesn't work

Hi guys, thanks for the update. The bottom line is that the box has nvme m2 and my drive is direct connected to the m2 slot (and not via a USB enclosure). With that in mind don't you feel that the system should be configuring the drive correctly. I appreciate that nvme is overkill but that's what the box has and the drive will at some point want to be trimmed?

Thanks
Paul
so to be clear is this a Octagon SF8008 V3 Supreme or previous sf8008 model. If the latter how is it attached ?
I
 
@smipx - take note of what @twol posted. I'm not sure why the receiver has NVMe as it's hardly needed in the particular enigma environment which does not require high disk throughput.
Perhaps because large M2 NVMe disks are cheaper that large M2 SSD ones?
 
Hi guys, thanks for the update. The bottom line is that the box has nvme m2 and my drive is direct connected to the m2 slot (and not via a USB enclosure).
It's connected to an M2 slot. How that M2 slot is connected to the rest of the system is another matter.
I suspect that it's through this:
Code:
 Bus 001 Device 003: ID 152d:0583 JMicron USB to PCIE Bridge
So you might need to set up a udev rule such as:
Code:
ACTION=="add|change", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="0583", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
However, you should first check that the unmap capability is available (with the sg3-utisl commands I mentioned earlier).
 
Hi Birdman, Here are the results from utils - does it sound promising? Looks like the HDPARM command did not work??


root@sf8008:~# sg_readcap -l /dev/sdd
Read Capacity results:
Protection: prot_en=0, p_type=0, p_i_exponent=0
Logical block provisioning: lbpme=0, lbprz=0
Last LBA=1953525167 (0x74706daf), Number of logical blocks=1953525168
Logical block length=512 bytes
Logical blocks per physical block exponent=3 [so physical block length=4096 bytes]
Lowest aligned LBA=0
Hence:
Device size: 1000204886016 bytes, 953869.7 MiB, 1000.20 GB

==============================================================================

root@sf8008:~# sg_vpd -a /dev/sdd
Supported VPD pages VPD page:
Supported VPD pages [sv]
Unit serial number [sn]
Device identification [di]
Block limits (SBC) [bl]
Block device characteristics (SBC) [bdc]
Logical block provisioning (SBC) [lbpv]
0xde
0xdf

Unit serial number VPD page:
Product serial number: 0123456789ABCDEF

Device Identification VPD page:
Addressed logical unit:
designator type: NAA, code set: Binary
0x3001234567891234
designator type: T10 vendor identification, code set: ASCII
vendor id: JMicron
vendor specific: Generic 0123456789ABCDEF

Block limits VPD page (SBC)
Write same non-zero (WSNZ): 0
Maximum compare and write length: 0 blocks [command not implemented]
Optimal transfer length granularity: 0x8
Maximum transfer length: 0xffff
Optimal transfer length: 0xffff
Maximum prefetch length: 0xffff
unlimited: Maximum unmap LBA count blocks
Maximum unmap block descriptor count: 0x3f
Optimal unmap granularity: 0 blocks [not reported]
Unmap granularity alignment valid: false
Maximum write same length: 0 blocks [not reported]
Maximum atomic transfer length: 0 blocks [not reported]
Atomic alignment: 0 blocks [unaligned atomic writes permitted]
Atomic transfer length granularity: 0 blocks [no granularity requirement]
Maximum atomic transfer length with atomic boundary: 0 blocks [not reported]
Maximum atomic boundary size: 0 blocks [can only write atomic 1 block]

Block device characteristics VPD page (SBC)
Non-rotating medium (e.g. solid state)
Product type: Not specified
WABEREQ=0
WACEREQ=0
Nominal form factor: not reported
MACT=0
ZONED=0 [not reported]
RBWZ=0
FUAB=0
VBULS=0
DEPOPULATION TIME: 0x0

Logical block provisioning VPD page (SBC)
LBPU=1
LBPWS=0
LBPWS10=0
LBPRZ=0x0
ANC_SUP=0
DP=0
Minimum percentage: 0 [not reported]
Provisioning type: not known or fully provisioned
Threshold percentage: 0 [percentages not supported]

NVMe Identify Controller Response (sg3_utils) VPD Page:
Only hex output supported
VPD page code=0xde:
00 de 00 0c 4a 4d 00 00 00 00 00 00 00 00 00 00


Only hex output supported
VPD page code=0xdf:
00 df 00 11 4a 4d 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00

======================================================

root@sf8008:~# hdparm -I /dev/sdd

/dev/sdd:
hdparm: HDIO_DRIVE_CMD: Invalid argument
 
Last edited:
It's connected to an M2 slot. How that M2 slot is connected to the rest of the system is another matter.
I suspect that it's through this:
Code:
 Bus 001 Device 003: ID 152d:0583 JMicron USB to PCIE Bridge
So you might need to set up a udev rule such as:
Code:
ACTION=="add|change", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="0583", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
However, you should first check that the unmap capability is available (with the sg3-utisl commands I mentioned earlier).
It might be best to see if @twol can integrate the needed fstrim into udev as standard in enigma as the Octagon is a supported receiver. By all means, if @smipx can do the running with his own receiver first it may speed the longer-term solution.
 
I'm happy to do stuff :-) Let me know what you would like me to do after digesting the results from the commands above. In the meantime I will do a backup of the drive overnight first (to be safe) :-)


rsync in progress so will return 2mo to do some more things. Let me know what I need to do (y)
 
Last edited:
It might be best to see if @twol can integrate the needed fstrim into udev as standard in enigma as the Octagon is a supported receiver. By all means, if @smipx can do the running with his own receiver first it may speed the longer-term solution.
Backup now complete so let me know what you think I should try and I'll give it a go.

Thanks
Paul
 
Hi Birdman, Here are the results from utils - does it sound promising?
Well, there's no mention in the sg_vpd output of "Unmap command supported" or "Unmap command not supported", so I'm not sure.

I do know that if I tried to set this up on something that couldn't handle it then fstrim just reported an error and nothing else happened.
 
the issue may well be that the device (absolutely)handles it, the software can handle it, but Octagon's hardware/firmware interface connection cannot.
Manuacturers tend to keep costs to a minimum when they buy components in bulk.
 
so to be clear is this a Octagon SF8008 V3 Supreme or previous sf8008 model. If the latter how is it attached ?
I
SF8008 V3 Supreme with M.2 NVME SSD - A con in plain clothing!.

I am guessing that it will not be possible to trim the drive then as it uses a hokey-pokey NVME=>USB interface to allow support for NVME but not actually have any of the benefits of an NVME drive - Octagon are a bit of a con in that regard and should hang thier heads in shame!!

I don't really care if my SSD is NVME or SATA - all I want to be able to do is trim the drive once in a while. As a non-linux user in all other respects of life I can't even take the drive out of the Octagon, pop it into an NVME Linux box and trim it.

I feel a bit stuck. At least the enigma2 doesn't need the speed of an NVME (or even a SATA) SSD so not trimming it will not be a major issue but it sucks nonetheless. I am a bit OCD when it comes to maintenance and not having a trimmed SSD makes me feel a bit anxious!

ps. Just for completeness - I booted up into ATV and it is the same (NVME=>USB) and not trimmable.

Cheers,
Paul
 
Last edited:
SF8008 V3 Supreme with M.2 NVME SSD - A con in plain clothing!.

I am guessing that it will not be possible to trim the drive then as it uses a hokey-pokey NVME=>USB interface to allow support for NVME but not actually have any of the benefits of an NVME drive - Octagon are a bit of a con in that regard and should hang thier heads in shame!!

I don't really care if my SSD is NVME or SATA - all I want to be able to do is trim the drive once in a while. As a non-linux user in all other respects of life I can't even take the drive out of the Octagon, pop it into an NVME Linux box and trim it.

I feel a bit stuck. At least the enigma2 doesn't need the speed of an NVME (or even a SATA) SSD so not trimming it will not be a major issue but it sucks nonetheless. I am a bit OCD when it comes to maintenance and not having a trimmed SSD makes me feel a bit anxious!

ps. Just for completeness - I booted up into ATV and it is the same (NVME=>USB) and not trimmable.

Cheers,
Paul
Glad you confirmed with openatv!
Unfortunately, the tech world has always been driven by profit (in my view) and when they are making huge profits they might be more customer supportive, but profits on this type of box are probably small, so the incentive is to do just what has to be done.
 
Except his box has a USB to PCIe connexion, which seems to be how the disk is accessed.

However, TRIM over USB can work anyway, I have several external USB SSDs (some SATA, some NVMe) all of which can be trimmed (and are once a month).
However, I do need to configure udev for the specific adaptors I have. See attached udev script.
I also need to run:
Code:
udevadm trigger --verbose --subsystem-match=scsi_disk
after plugging them in, as for some reason this doesn't happen automatically (it did until ~3 years ago)
If I run the udevadm trigger --verbose --subsystem-match=scsi_disk I get:

/sys/devices/platform/soc/f9890000.ehci/usb1/1-1/1-1.4/1-1.4:1.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0

what I dont get though if I run udevadm info -a -n /dev/sdd ...... is a serial number for the device in the ATTR fields so I don't think I can even add a UDEV override. There are serial numners for some of the parent devices but I don't think these are the right ones.

looking at device '/devices/platform/soc/f9890000.ehci/usb1/1-1/1-1.4/1-1.4:1.0/host0/target0:0:0/0:0:0:0/block/sdd':
KERNEL=="sdd"
SUBSYSTEM=="block"
DRIVER==""
ATTR{ro}=="0"
ATTR{size}=="1953525168"
ATTR{stat}==" 15886 32 3873114 280944 16910 10086 8410064 1177061 0 747605 1457960"
ATTR{range}=="16"
ATTR{discard_alignment}=="0"
ATTR{events}==""
ATTR{ext_range}=="256"
ATTR{events_poll_msecs}=="-1"
ATTR{alignment_offset}=="0"
ATTR{inflight}==" 0 0"
ATTR{removable}=="0"
ATTR{capability}=="50"
ATTR{events_async}==""


looking at parent device '/devices/platform/soc/f9890000.ehci/usb1/1-1/1-1.4/1-1.4:1.0/host0/target0:0:0/0:0:0:0':
KERNELS=="0:0:0:0"......................................
.......................


I think I am at the end of my journey to be able to trim the SSD sadly. Not being a linux expert I don't know for sure but I would be very happy for someone to contradict me and put me on the right path.
 
what I dont get though if I run udevadm info -a -n /dev/sdd ...... is a serial number for the device in the ATTR fields so I don't think I can even add a UDEV override.
You don't need a serial number (which would be specific to the disk). You just need the idVendor and idProduct of the USB interface (see post #23)
 
Hi guys, thanks for the update. The bottom line is that the box has nvme m2 and my drive is direct connected to the m2 slot (and not via a USB enclosure). With that in mind don't you feel that the system should be configuring the drive correctly. I appreciate that nvme is overkill but that's what the box has and the drive will at some point want to be trimmed?

Thanks
Paul
Got it (finally!!).

So I go to /etc/udev/rules.d and create a rule called m2ssd.rules and add a single line to it of

ACTION=="add|change", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="0583", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"

Save..
Reboot..

Give the trim a go and see?? or do I then need to run your .sh script instead?.

One question. If it is at the USB driver level then will any USB HDD that I also plug-in be adversely affected (like my USB HDD) and what about other things that get plugged into USB like memory sticks etc. Just double checking before I take the plunge.
 
so.... I did that and gave the fstrim a go. It waited for about 20 seconds doing something and then came back with:

fstrim: /media/hdd: FITRIM ioctl failed: Remote I/O error

:-(
 
Since removed the Udev rule as its clearly not going to work. Def. the end of the road for it I guess my only option is to get a USB NVME enclosure, boot my windwos PC to linux mint using VMWare Workstation, plug the drive in and see if I can do an FSTrim that way. Maybe someting to do once a year!!

Cheers,
Paul
 
Interesting as I was going to get one of those enclosures to attach it to my VM to use trim. I don't think I'll bother now. If that is the same chipset and it allegedly supports trim than I wonder if there are any driver tweaks in enigma2 possible to get it working?

If anyone wants me to test further I am happy to do so but am at the end of the line for my own knowlege without further guidance :-)
 
actually - this is the enclosure I was toying with:

fanxiang M.2 NVMe Enclosure, With Built-in Cooling Fan System SSD Enclosure, USB 3.2 Gen2 10Gbps, Up to 4TB M Key/B+M Key, With USB C to C and USB A to C Cables for 2230/2242/2280—MD85​



The idea was to try to cover all bases including my M.2 SATA SSD in my laptop, my NVME M.2 in the desktop and possibly the SSD in the sf8008...... but if I can't be sure the sf8008 SSD will be trimmable with one then I don't really need.
 

OpenViX Feeds Status

Back
Top