차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 | ||
tech:trim [2012/01/19 10:14] – 새로 만듦 vaslor | tech:trim [2016/07/12 09:26] (현재) – 바깥 편집 127.0.0.1 | ||
---|---|---|---|
줄 1: | 줄 1: | ||
+ | {{tag> | ||
+ | ======Trim on SSD====== | ||
+ | |||
+ | 트림을 알려면 아래의 개념을 다 이해해야 한다. | ||
+ | |||
+ | 출처: http:// | ||
+ | |||
+ | =====Spreading===== | ||
+ | |||
+ | 해석하면 넓게 펼쳐 쓰는 것이다. 예를 들어 파일을 다시 쓸 경우, 원래 위치에 저장하는 것이 아니라, 다른 깨끗한 영역으로 옮겨 가며 쓰기를 하는 것이다. 이렇게 할 경우, 이미 포맷된 깨끗한 영역에 쓰기를 하기 때문에, 삭제로 인한 쓰기 속도가 하락이 생기지 않는다. 즉, 삭제하는 절차를 피하여 **성능**을 높이는 것이다. 또한, 같은 영역을 반복해서 써서 발생하는 수명 문제도 어느정도 극복할 수 있다. | ||
+ | |||
+ | 다만, 이렇게 사용할 경우, 비어 있는 모든 영역에 죄다 한번씩 쓰기를 하게 된 이후로부터는, | ||
+ | |||
+ | =====Counting===== | ||
+ | |||
+ | 해당 영역을 몇번 쓰기를 했는지, 그 쓰기 횟수(주: 좀더 정확히는 삭제 횟수)를 저장한다. 그리고, 쓰기 횟수가 적은 영역을 먼저 사용하도록 하는 기법이다. Spreading 과 병행해서 사용한다. 성능과는 무관하고, | ||
+ | |||
+ | =====Swapping===== | ||
+ | |||
+ | Counting 을 하더라도, | ||
+ | |||
+ | =====Garbage Collection===== | ||
+ | |||
+ | GC 는 일반적으로 메모리 관리에 나오는 용어인데, | ||
+ | |||
+ | =====TRIM===== | ||
+ | |||
+ | 앞서 설명했듯이 GC 를 OS 가 자동으로 해주도록 해주는 기능이며, | ||
+ | |||
+ | 트림(Trim)기능이란 무엇입니까? | ||
+ | http:// | ||
+ | |||
+ | =====저널링끄기===== | ||
+ | ext4의 저널을 어떻게 끌 것인가? 첫번째, 저널의 제거는 파일시스템이 마운트된 상태에서는 할 수 없다. 운영체제가 포함된 드라이브의 저널을 끄려면, 다른 드라이브로 부팅하는게 필요하다. 난 Arch Linux를 사용하고, | ||
+ | |||
+ | 다른 디스크로 부팅 했으면, 터미널을 열고 루트 권한을 얻거나 sudo를 사용해 명령어를 입력해라. | ||
+ | 명령어: | ||
+ | tune2fs -O ^has_journal /dev/sda1 | ||
+ | 그리고 나서 파일시스템 검사를 돌리는게 좋다. | ||
+ | e2fsck -f /dev/sda1 | ||
+ | [출처] 리눅스 SSD, TRIM|작성자 gccc | ||
+ | |||
+ | |||
+ | http:// | ||
+ | =====Trim on ubuntu===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | There are two forms of TRIM, manual (wiper.sh) and automatic: | ||
+ | |||
+ | 1) Manual TRIM | ||
+ | |||
+ | In ubuntu this can be performed with wiper.sh, but is not needed when automatic TRIM is enabled. | ||
+ | |||
+ | 2) Automatic TRIM | ||
+ | |||
+ | Automatic TRIM is supported since kernel 2.6.33 with the EXT4 file system | ||
+ | |||
+ | For automatic TRIM to work, the drive needs to be mounted with the " | ||
+ | |||
+ | sudo cp /etc/fstab ~/ | ||
+ | gksudo gedit /etc/fstab | ||
+ | add discard to options on the entry for the SSD; the line should read similar to this: | ||
+ | |||
+ | UUID=ed586ab8-08c5-4bae-b118-d191b716b4a4 / | ||
+ | reboot, automatic TRIM should now be working. | ||
+ | |||
+ | Testing automatic TRIM: | ||
+ | |||
+ | To Test if Trim is working issue the following commands (adapted from here): | ||
+ | |||
+ | cd / #or whatever part of the file system is on the SSD | ||
+ | sudo dd if=/ | ||
+ | sudo hdparm --fibmap tempfile | ||
+ | From the output copy the number under " | ||
+ | |||
+ | sudo hdparm --read-sector 2638848 /dev/sda #replace 2638848 with the number obtained before and /sda with your SSD drive | ||
+ | you should receive a a long string of characters for those sectors | ||
+ | |||
+ | sudo rm tempfile | ||
+ | sync | ||
+ | sudo hdparm --read-sector 2638848 /dev/sda | ||
+ | even after removing the file the sectors are still not empty. Wait a while then run the command again | ||
+ | |||
+ | sudo hdparm --read-sector 2638848 /dev/sda | ||
+ | if you get only zeros, then automatic TRIM is working. | ||
+ | |||
+ | |||
+ | * 출처: [[|]] | ||
+ | |||
+ | ^ 누구나 수정하실 수 있습니다. | ||
+ | |||
+ | |||