Re: configurable discard parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First of all let me add another "statistic" about the issue:

[tom@localhost ~]$ sudo shred -n 1 /dev/sda3
[tom@localhost ~]$ sudo blkdiscard /dev/sda3
[tom@localhost ~]$ sudo hexdump /dev/sda3 | wc -l
310635
[tom@localhost ~]$ sudo hexdump /dev/sda3 | pcregrep -M '0000 0000
0000 0000 0000 0000 0000 0000\n\*' | wc -l
2410

total untrimmed sectors: (310635 - 1 - 2410) / 32 = 9632
total ranges: (43 GiB * (1024 ^ 3) / 512) / 65535 ~= 1376
average untrimmed sectors per range: (9632 / 1376) = 7 = (65535 % 8)

Also, FWIW:

[tom@localhost ~]$ sudo shred -n 1 /dev/sda3
[tom@localhost ~]$ let step=(65535-65535%8)*512
[tom@localhost ~]$ echo $step
33550336
[tom@localhost ~]$ sudo blkdiscard -p "$step" /dev/sda3
[tom@localhost ~]$ sudo hexdump /dev/sda3
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
ac0000000

On 24 June 2015 at 02:26, Martin K. Petersen <martin.petersen@xxxxxxxxxx> wrote:
>
> What happens if you discard sectors 0-6 and then sector 7?
>

[tom@localhost ~]$ sudo shred -n 1 /dev/sda3
[tom@localhost ~]$ sudo blkdiscard -l 3584 /dev/sda3
[tom@localhost ~]$ sudo blkdiscard -o 3584 -l 512 /dev/sda3
[tom@localhost ~]$ sudo hexdump -n 4096 /dev/sda3
0000000 f06d 8365 5e1b 616c 7362 4d61 2182 02fb
...
0000ff0 54ef 9579 51bc 9042 115a 375e c28f 4dcc
0001000

>
> This is on the Intel 530? What does the drive report in
> /sys/block/sdN/queue/discard_zeroes_data?
>

Yes. It reports 0. In `hdparm -I`:
       *    Data Set Management TRIM supported (limit 1 block)
       *    Deterministic read data after TRIM

You may also want to check out and compare the two attached test case files.

Attachment: sandisk_test
Description: Binary data

Attachment: intel_test
Description: Binary data


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux