Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[gelöst] fstrim funktioniert nicht
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
wuesti
Apprentice
Apprentice


Joined: 07 Mar 2009
Posts: 191

PostPosted: Tue Jun 03, 2014 5:08 pm    Post subject: [gelöst] fstrim funktioniert nicht Reply with quote

Moin Moin!

Das Trimmen meiner SSD funktioniert nicht.

Wenn ich nach dem Systemstart fstrim -v / eingebe, so trimmt die Platte angeblich 17GB Daten. Beim zweiten Trim sind es 0 Bytes. Auf der Platte ist das Trimmen aber nicht angekommen.

Unten habe ich alle wichtigen Informationen aufgelistet.

Kann jemand helfen?

Vielen Dank
wuesti


Code:
hdparm -I /dev/sda                   

/dev/sda:

ATA device, with non-removable media
   Model Number:       ADATA SP900                             
   Serial Number:      7D4020009144       
   Firmware Revision:  5.2.0   
   Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
   Used: unknown (minor revision code 0x0110)
   Supported: 8 7 6 5
   Likely used: 8
Configuration:
   Logical      max   current
   cylinders   16383   16383
   heads      16   16
   sectors/track   63   63
   --
   CHS current addressable sectors:   16514064
   LBA    user addressable sectors:  125043311
   LBA48  user addressable sectors:  125043311
   Logical  Sector size:                   512 bytes
   Physical Sector size:                   512 bytes
   Logical Sector-0 offset:                  0 bytes
   device size with M = 1024*1024:       61056 MBytes
   device size with M = 1000*1000:       64022 MBytes (64 GB)
   cache/buffer size  = unknown
   Nominal Media Rotation Rate: Solid State Device
Capabilities:
   LBA, IORDY(can be disabled)
   Queue depth: 32
   Standby timer values: spec'd by Standard, with device specific minimum
   R/W multiple sector transfer: Max = 16   Current = 16
   Advanced power management level: 254
   DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
        Cycle time: min=120ns recommended=120ns
   PIO: pio0 pio1 pio2 pio3 pio4
        Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
...
      *   Data Set Management TRIM supported (limit 1 block)

Code:
cat /etc/fstab | grep /dev/sda
/dev/sda1   /   ext4      defaults,noatime,discard   0 1

Code:
 # dd if=/dev/urandom of=tempfile count=10 bs=512k oflag=direct
10+0 Datensätze ein
10+0 Datensätze aus
5242880 Bytes (5,2 MB) kopiert, 0,516964 s, 10,1 MB/s
# hdparm --fibmap tempfile

tempfile:
 filesystem blocksize 4096, begins at LBA 2048; assuming 512 byte sectors.
 byte_offset  begin_LBA    end_LBA    sectors
           0   39629824   39631871       2048
     1048576   39768064   39770111       2048
     2097152   39618560   39622655       4096
     4194304   39806976   39809023       2048
# hdparm --read-sector 39629824 /dev/sda

/dev/sda:
reading sector 39629824: succeeded
c81a 9783 3d04 820d 6f84 624a 3607 ff6a
7279 462f 7c64 c26f 7738 90a3 29a8 e891
ca1d dcbd 0aca 8a65 fab0 8e40 2901 b5d2
1b94 cbff aff4 a771 0f72 7f3c b6a3 45c2
9420 1cf7 fe66 88fb 54e4 49d5 b5ae d48b
....

# rm tempfile
# sync
# hdparm --read-sector 39629824 /dev/sda

/dev/sda:
reading sector 39629824: succeeded
c81a 9783 3d04 820d 6f84 624a 3607 ff6a
7279 462f 7c64 c26f 7738 90a3 29a8 e891
ca1d dcbd 0aca 8a65 fab0 8e40 2901 b5d2
1b94 cbff aff4 a771 0f72 7f3c b6a3 45c2

_________________
Linux-User seit 1999


Last edited by wuesti on Tue Jun 03, 2014 7:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Tue Jun 03, 2014 5:11 pm    Post subject: Reply with quote

Nur weil du Sektoren trimmst, sind die danach nicht unbeding genullt, das sagt der Platte nur, dass diese nicht in Verwendung sind. Davon ab fehlt bei deinem Test der Trim.
Back to top
View user's profile Send private message
wuesti
Apprentice
Apprentice


Joined: 07 Mar 2009
Posts: 191

PostPosted: Tue Jun 03, 2014 5:31 pm    Post subject: Reply with quote

py-ro wrote:
Nur weil du Sektoren trimmst, sind die danach nicht unbeding genullt, das sagt der Platte nur, dass diese nicht in Verwendung sind. Davon ab fehlt bei deinem Test der Trim.


discard in der /etc/fstab soll freigegebene Sektoren während des Betriebs trimmen.

Nach jedem Neustart werden 17GB getrimmt. Was etwa dem gesamten freien Speicher auf der Platte entspricht.

Code:
# fstrim -v /
/: 0 B (0 bytes) trimmed

# hdparm --read-sector 39629824 /dev/sda

/dev/sda:
reading sector 39629824: succeeded
0001 0000 283a 0000 c5e6 0002 7279 0000
2a0a 0003 a836 0007 f55f 000e 8968 0010
2e9a 0016 3dff 001e 5d38 001f 0763 0028
f269 0029 59bb 002c 32bc 002e f072 0037
0d18 003b 4c18 003d 4bd9 003f 8a29 0043

_________________
Linux-User seit 1999
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Tue Jun 03, 2014 5:41 pm    Post subject: Reply with quote

Das mit den 17GB ist normal, da Trim ein oneway ist, das Betriebssystem hat keine Möglichkeit festzustellen welche Sektoren die SSD als nicht verwendet/getrimmt ansieht.
Back to top
View user's profile Send private message
wuesti
Apprentice
Apprentice


Joined: 07 Mar 2009
Posts: 191

PostPosted: Tue Jun 03, 2014 5:54 pm    Post subject: Reply with quote

Und nach dem Neustart ...
Code:
# fstrim -v /
/: 17,6 GiB (18893623296 bytes) trimmed

# fstrim -v /
/: 0 B (0 bytes) trimmed

# df -h
Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
/dev/sda1        48G     30G   16G   66% /

_________________
Linux-User seit 1999
Back to top
View user's profile Send private message
wuesti
Apprentice
Apprentice


Joined: 07 Mar 2009
Posts: 191

PostPosted: Tue Jun 03, 2014 6:35 pm    Post subject: Reply with quote

py-ro wrote:
Das mit den 17GB ist normal, da Trim ein oneway ist, das Betriebssystem hat keine Möglichkeit festzustellen welche Sektoren die SSD als nicht verwendet/getrimmt ansieht.


Daraus folgt doch, dass ich nicht überprüfen kann, ob fstrim,discard funktioniert?
_________________
Linux-User seit 1999
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Tue Jun 03, 2014 7:01 pm    Post subject: Reply with quote

Richtig.
Back to top
View user's profile Send private message
wuesti
Apprentice
Apprentice


Joined: 07 Mar 2009
Posts: 191

PostPosted: Tue Jun 03, 2014 7:13 pm    Post subject: Reply with quote

py-ro wrote:
Richtig.


Doch

  • Discard in /etc/fstab abstellen
  • reboot
  • Code:
    # fstrim -v /
    /: 18,1 GiB (19400491008 bytes) trimmed

  • nun Dateien löschen
  • Code:
    # fstrim -v /
    /: 2,7 GiB (2896080896 bytes) trimmed

_________________
Linux-User seit 1999
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Tue Jun 03, 2014 7:21 pm    Post subject: Reply with quote

Ähm, ist das selbe wir vorher, vorher hat das Discard gemacht, daher hat fstrim dann 0 gehabt beim zweiten mal.

[EDIT]Das sagt quasi nur, dass der trim befehl abgesetzt wurde, was die SSD damit macht ist vertrauenssache.[/EDIT]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum