Skip to content

Permission denied. #1

@TotalCoolness

Description

@TotalCoolness

Thanks for your script.

I got permission denied. But it seemed to have worked. I even got permission denied when I executed the sudo command manually.

sudo echo unmap > /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2:1.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0/provisioning_mode

Well after I rebooted and enable the service I get:

Active: failed (Result: exit-code) since Sat 2021-08-21 00:00:30 BST; 2min 56s ago
Process: 428 ExecStart=/usr/bin/python3 /usr/local/bin/trim.py sda (code=exited, status=1/FAILURE)
Main PID: 428 (code=exited, status=1/FAILURE)

Aug 21 00:00:30 raspberrypi4b python3[428]: Setting the maximum number of bytes to discard in /sys/class/block/sda/queue/discard_max_bytes to 1073
Aug 21 00:00:30 raspberrypi4b python3[428]: OSError: [Errno 22] Invalid argument
Aug 21 00:00:30 raspberrypi4b python3[428]: During handling of the above exception, another exception occurred:
Aug 21 00:00:30 raspberrypi4b python3[428]: Traceback (most recent call last):
Aug 21 00:00:30 raspberrypi4b python3[428]: File "/usr/local/bin/trim.py", line 221, in
Aug 21 00:00:30 raspberrypi4b python3[428]: tFile.close()
Aug 21 00:00:30 raspberrypi4b python3[428]: OSError: [Errno 22] Invalid argument
Aug 21 00:00:30 raspberrypi4b systemd[1]: enable_trim.service: Main process exited, code=exited, status=1/FAILURE
Aug 21 00:00:30 raspberrypi4b systemd[1]: enable_trim.service: Failed with result 'exit-code'.
Aug 21 00:00:30 raspberrypi4b systemd[1]: Failed to start Activate TRIM for SSD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions