# 아래는 여러 인터넷 사이트에서 설명하는 내용 - 정확치 않음 (이것때문에 삽질 여러번 ㅜ.ㅜ)

# dd if=/dev/urandom of=tmpfile bs=1M count=3

3+0 records in

3+0 records out

3145728 bytes (3.1 MB) copied, 0.443321 s, 7.1 MB/s


# hdparm --fibmap tmpfile 


tmpfile: underlying filesystem: blocksize 4096, begins at LBA 63; assuming 512 byte sectors

 byte_offset  begin_LBA    end_LBA    sectors

           0    1318991    1325134       6144


# hdparm --read-sector 1318991 /dev/sdb 


/dev/sdb: 

reading sector 1318991: succeeded 

b0e8 3ad7 d080 84e8 b4b2 7e60 21f1 eff3 

0ef9 fa10 b172 89f8 186f 0194 4cb1 e190 

.......................................


# rm tempfile && sync && sleep 120


# hdparm --read-sector 1318991 /dev/sdb 


/dev/sdb: 

reading sector 1318991: succeeded 

0000 0000 0000 0000 0000 0000 0000 0000 

0000 0000 0000 0000 0000 0000 0000 0000 

....................................... 



위와 같이 0000 으로 채워져야 이상없이 trim 기능 작동하는 것임



# 정확한 방법
# 간단한 확인 방법
# TRIM 기능이 적용되도, 파일의 처음 1개 섹터와 마지막 7개 섹터는 내용이 변하지 않고 나머지 섹터는 0000으로 체워짐
# 바로 윗줄은 불변의 얘기는 아니고, 시스템에 따라 처음 2개 또는 그 이상의 색터도 내용이 변하지 안는 경우도 있음, 
# 여러 섹터를 확인해봐야함

# dd if=/dev/urandom of=tmpfile bs=1M count=3

3+0 records in

3+0 records out

3145728 bytes (3.1 MB) copied, 0.362944 s, 8.7 MB/s


# hdparm --fibmap tmpfile

tmpfile:

 filesystem blocksize 4096, begins at LBA 63; assuming 512 byte sectors.

 byte_offset  begin_LBA    end_LBA    sectors

           0     369727     375870       6144

 

# hdparm --read-sector 369728 /dev/sdd

/dev/sdd:

reading sector 369728: succeeded

b560 f5cd 3258 40d7 a6b6 0a09 23b6 651e

5804 266f e94d 846e 07ed d601 eab3 3c20 

....................................... 

# rm -f tmpfile && sync && sleep 10

# hdparm --read-sector 
369728 /dev/sdd
/dev/sdd:
reading sector 369728: succeeded
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
....................................... 


# 위 내용 세부 설명
# TRIM 기능이 적용되도, 파일의 처음 1개 섹터와 마지막 7개 섹터는 내용이 변하지 않고 나머지 섹터는 0000으로 체워짐
# 바로 윗줄은 불변의 얘기는 아니고, 시스템에 따라 처음 2개 또는 그 이상의 색터도 내용이 변하지 안는 경우도 있음, 
# 여러 섹터를 확인해봐야함
# 따라서 처음과 끝 섹터에서 일정 섹터(보통 2~30이하)를 검사해야 정확하게 판단 가능함

# dd if=/dev/urandom of=tmpfile bs=1M count=3

3+0 records in

3+0 records out

3145728 bytes (3.1 MB) copied, 0.362944 s, 8.7 MB/s


# hdparm --fibmap tmpfile

tmpfile:

 filesystem blocksize 4096, begins at LBA 63; assuming 512 byte sectors.

 byte_offset  begin_LBA    end_LBA    sectors

           0     369727     375870       6144


# hdparm --read-sector 369727 /dev/sdd

/dev/sdd:

reading sector 369727: succeeded

24f5 2e3a 9b74 1748 d299 7898 3f7d 28a3

c4fa aff3 a5db f760 249b d416 1a75 8f32

....................................... 


# hdparm --read-sector 369728 /dev/sdd

/dev/sdd:

reading sector 369728: succeeded

b560 f5cd 3258 40d7 a6b6 0a09 23b6 651e

5804 266f e94d 846e 07ed d601 eab3 3c20 

....................................... 
 

# hdparm --read-sector 375870 /dev/sdd

/dev/sdd:

reading sector 375870: succeeded

46d9 4d96 afc9 aa44 a255 d1bf d8b0 f63f

6c44 8f79 0225 f2f8 fd19 6041 9cf7 ad9c
....................................... 
 

# hdparm --read-sector 375869 /dev/sdd

/dev/sdd:

reading sector 375869: succeeded

b765 1f8f 15fb 2143 ff81 5216 6a58 2bba

da61 658e 106b 95d2 52c4 5764 cfff 4b72

....................................... 
 

# hdparm --read-sector 375868 /dev/sdd

/dev/sdd:

reading sector 375868: succeeded

51e7 7313 c3f4 5344 99d9 2e24 35bc 8033

242a 5d09 6aee c045 7ff0 a1b2 e47b 5b04

....................................... 
 

# hdparm --read-sector 375867 /dev/sdd
/dev/sdd:
reading sector 375867: succeeded
bcc6 0c16 f092 4441 98e6 1681 5688 752a
a702 8676 5685 7c82 2c33 1b59 dcd8 bd99

....................................... 
 

# hdparm --read-sector 375866 /dev/sdd

/dev/sdd:

reading sector 375866: succeeded

a92f 15f3 8025 dda3 7ef4 8498 ea4a b96d

e200 d9cc 7ca8 ea18 99b1 f26b 3ace dc02

....................................... 
 

# hdparm --read-sector 375865 /dev/sdd
/dev/sdd:
reading sector 375865: succeeded
5860 288a 5800 ca86 d51b abf0 f374 e875
be93 0eaf 5ffa 279c 5f39 1b87 78a8 c9f8
....................................... 
 

# hdparm --read-sector 375864 /dev/sdd
/dev/sdd:
reading sector 375864: succeeded
daa8 885c d276 66d8 caf5 bfe4 b8b2 28c2
543e 87d6 d583 c582 d68b 0259 5d8b c09b
....................................... 
 

# hdparm --read-sector 375863 /dev/sdd
/dev/sdd:
reading sector 375863: succeeded
115a bf14 0442 7b71 419e 078e 5f01 3e2d
6fdf 4ce7 8f0e dd55 8988 5c5e a211 36ad
....................................... 

# hdparm --read-sector 375862 /dev/sdd
/dev/sdd:
reading sector 375862: succeeded
64e5 533a 71a9 d75e d450 6e53 1ade 059a
e838 8c97 8b6e 5bfa 2721 3a87 ffe1 0da5
....................................... 

# hdparm --read-sector 375861 /dev/sdd
/dev/sdd:
reading sector 375861: succeeded
2b67 3c1e 2d5d 80dc 6a4a 5f57 70f5 a7c4
b85f 03dc 5cdf 6152 78da 7ac2 9020 4133
....................................... 
 

# rm -f tmpfile && sync && sleep 10

# hdparm --read-sector 369727 /dev/sdd
/dev/sdd:
reading sector 369727: succeeded
24f5 2e3a 9b74 1748 d299 7898 3f7d 28a3
c4fa aff3 a5db f760 249b d416 1a75 8f32
....................................... 
 

# hdparm --read-sector 369728 /dev/sdd
/dev/sdd:
reading sector 369728: succeeded
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
....................................... 
 

# hdparm --read-sector 375870 /dev/sdd
/dev/sdd:
reading sector 375870: succeeded
46d9 4d96 afc9 aa44 a255 d1bf d8b0 f63f
6c44 8f79 0225 f2f8 fd19 6041 9cf7 ad9c
....................................... 

# hdparm --read-sector 375869 /dev/sdd
/dev/sdd:
reading sector 375869: succeeded
b765 1f8f 15fb 2143 ff81 5216 6a58 2bba
da61 658e 106b 95d2 52c4 5764 cfff 4b72
....................................... 

# hdparm --read-sector 375868 /dev/sdd
/dev/sdd:
reading sector 375868: succeeded
51e7 7313 c3f4 5344 99d9 2e24 35bc 8033
242a 5d09 6aee c045 7ff0 a1b2 e47b 5b04
....................................... 

# hdparm --read-sector 375867 /dev/sdd
/dev/sdd:
reading sector 375867: succeeded
bcc6 0c16 f092 4441 98e6 1681 5688 752a
a702 8676 5685 7c82 2c33 1b59 dcd8 bd99
....................................... 

# hdparm --read-sector 375866 /dev/sdd
/dev/sdd:
reading sector 375866: succeeded
a92f 15f3 8025 dda3 7ef4 8498 ea4a b96d
e200 d9cc 7ca8 ea18 99b1 f26b 3ace dc02
....................................... 

# hdparm --read-sector 375865 /dev/sdd
/dev/sdd:
reading sector 375865: succeeded
5860 288a 5800 ca86 d51b abf0 f374 e875
be93 0eaf 5ffa 279c 5f39 1b87 78a8 c9f8
....................................... 

# hdparm --read-sector 375864 /dev/sdd
/dev/sdd:
reading sector 375864: succeeded
daa8 885c d276 66d8 caf5 bfe4 b8b2 28c2
543e 87d6 d583 c582 d68b 0259 5d8b c09b 

....................................... 

# hdparm --read-sector 375863 /dev/sdd

/dev/sdd:

reading sector 375863: succeeded

0000 0000 0000 0000 0000 0000 0000 0000

0000 0000 0000 0000 0000 0000 0000 0000

....................................... 

# hdparm --read-sector 375862 /dev/sdd


/dev/sdd:

reading sector 375862: succeeded

0000 0000 0000 0000 0000 0000 0000 0000

0000 0000 0000 0000 0000 0000 0000 0000

....................................... 
 

# hdparm --read-sector 375861 /dev/sdd

/dev/sdd:

reading sector 375861: succeeded

0000 0000 0000 0000 0000 0000 0000 0000

0000 0000 0000 0000 0000 0000 0000 0000

....................................... 



'Linux' 카테고리의 다른 글

파티션 UUID 확인 하는 방법  (1) 2012.02.17
awk IP주소 가져오기  (0) 2012.02.07
man 내용 파일로 저장하기  (0) 2012.02.02
areca 1212-1222 핫스페이, 리빌드 관련 정보  (0) 2012.01.17
GeoIP 업데이트  (0) 2011.12.29
Posted by 광장군
,