리눅스에서는 명령행에서 Home 키를 누르면 현재 명령의 맨 앞 글자로, End 키를 누르면 맨 뒤 글자로 커서를 옮길 수 있는데 맥에서는 그게 안 됩니다. 맥에서는 다음 단축키를 사용하면 됩니다. Ctrl은 컨트롤 키입니다 (커맨드 키가 아닙니다).

 

명령행 맨 앞 글자로 가기: Ctrl + A

명령행 맨 뒤 글자로 가기: Ctrl + E

f3을 사용하여 SD카드 및 USB 불량 여부 확인하기

 

집에서 사용하던 SD 카드가 있었는데 어느 순간부터 읽기가 잘 안 되었습니다. 수명이 다 하면 쓰기가 안 되는 경우는 예전에 본 적이 있는데 이번 SD 카드는 쓰기는 되고 읽기가 안 되었습니다. 어떻게 하면 불량 여부를 검사할 수 있을지 알아보다가 f3이라는 프로그램을 알게 되었습니다. f3은 Fight Flash Fraud의 약자로 "가짜 플래시 메모리와 싸우자" 정도의 뜻입니다. 공식 웹사이트는 https://fight-flash-fraud.readthedocs.io/ 이고 깃허브 주소는 https://github.com/AltraMayor/f3 입니다. 설치 방법은 웹사이트를 참조하시면 되는데, 리눅스나 맥 환경에서 설치 가능하고 윈도에서는 도커를 사용하면 됩니다.

 

설치가 끝나면 f3write를 통해 SD 카드 혹은 USB에 테스트용 데이터를 쓰고, 그 후 f3read를 통해 데이터를 잘 읽을 수 있는지 검사하면 됩니다. 먼저 f3write를 통해 다음과 같이 제 SD 카드를 검사하였습니다. /Volumes/my_sd_card 에는 SD 카드가 마운트 된 위치를 써 주시면 됩니다. 제 SD 카드는 32 GB 짜리이고 쓰기 속도는 평균 16.52 MB/s 라고 합니다. 일단 쓰기는 잘 되었습니다.

 

주의!! SD 카드에 테스트용 데이터를 쓰게 되므로 기존에 있던 데이터가 삭제될 수 있으니 기존 데이터를 일단 백업해놓은 뒤에 테스트하세요.

$ f3write /Volumes/my_sd_card
F3 write 8.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

Free space: 31.23 GB
Creating file 1.h2w ... OK!
Creating file 2.h2w ... OK!
Creating file 3.h2w ... OK!
Creating file 4.h2w ... OK!
Creating file 5.h2w ... OK!
Creating file 6.h2w ... OK!
Creating file 7.h2w ... OK!
Creating file 8.h2w ... OK!
Creating file 9.h2w ... OK!
Creating file 10.h2w ... OK!
Creating file 11.h2w ... OK!
Creating file 12.h2w ... OK!
Creating file 13.h2w ... OK!
Creating file 14.h2w ... OK!
Creating file 15.h2w ... OK!
Creating file 16.h2w ... OK!
Creating file 17.h2w ... OK!
Creating file 18.h2w ... OK!
Creating file 19.h2w ... OK!
Creating file 20.h2w ... OK!
Creating file 21.h2w ... OK!
Creating file 22.h2w ... OK!
Creating file 23.h2w ... OK!
Creating file 24.h2w ... OK!
Creating file 25.h2w ... OK!
Creating file 26.h2w ... OK!
Creating file 27.h2w ... OK!
Creating file 28.h2w ... OK!
Creating file 29.h2w ... OK!
Creating file 30.h2w ... OK!
Creating file 31.h2w ... OK!
Creating file 32.h2w ... OK!
Free space: 576.00 KB
Average writing speed: 16.52 MB/s
$

 

이제 읽기를 테스트할 차례입니다. 다음과 같이 f3read를 사용합니다. 왼쪽에서 오른쪽으로 ok / corrupted / changed / overwritten 이라고 되어 있는데, 정상 SD 카드라면 ok를 뺀 나머지 칸은 다 0이어야 합니다. 제 SD 카드의 경우는 7번째 구간까지는 정상적이나 8번째 구간부터 데이터가 망가져 있는 것을 볼 수 있습니다. 테스트가 끝나면 요약을 해 주는데 이 SD 카드는 전체 32 GB 중 7.48 GB 만 정상이고 나머지는 고장난 카드입니다. 버려야겠습니다.

$ f3read /Volumes/my_sd_card
F3 read 8.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

                  SECTORS      ok/corrupted/changed/overwritten
Validating file 1.h2w ... 2097152/        0/      0/      0
Validating file 2.h2w ... 2097152/        0/      0/      0
Validating file 3.h2w ... 2097152/        0/      0/      0
Validating file 4.h2w ... 2097152/        0/      0/      0
Validating file 5.h2w ... 2097152/        0/      0/      0
Validating file 6.h2w ... 2097152/        0/      0/      0
Validating file 7.h2w ... 2097152/        0/      0/      0
Validating file 8.h2w ... 1009269/  1087883/      0/      0
Validating file 9.h2w ...       0/  2097152/      0/      0
Validating file 10.h2w ...       0/  2097152/      0/      0
Validating file 11.h2w ...       0/  2097152/      0/      0
Validating file 12.h2w ...       0/  2097152/      0/      0
Validating file 13.h2w ...       0/  2097152/      0/      0
Validating file 14.h2w ...       0/  2097152/      0/      0
Validating file 15.h2w ...       0/  2097152/      0/      0
Validating file 16.h2w ...    2880/  2094272/      0/      0
Validating file 17.h2w ...       0/  2097152/      0/      0
Validating file 18.h2w ...       0/  2097152/      0/      0
Validating file 19.h2w ...       0/  2097152/      0/      0
Validating file 20.h2w ...       0/  2097152/      0/      0
Validating file 21.h2w ...       0/  2097152/      0/      0
Validating file 22.h2w ...       0/  2097152/      0/      0
Validating file 23.h2w ...       0/  2097152/      0/      0
Validating file 24.h2w ...       0/  2097152/      0/      0
Validating file 25.h2w ...       0/  2097152/      0/      0
Validating file 26.h2w ...       0/  2097152/      0/      0
Validating file 27.h2w ...       0/  2097152/      0/      0
Validating file 28.h2w ...       0/  2097152/      0/      0
Validating file 29.h2w ...       0/  2097152/      0/      0
Validating file 30.h2w ...       0/  2097152/      0/      0
Validating file 31.h2w ...       0/  2097152/      0/      0
Validating file 32.h2w ...     640/   488961/      0/      0

  Data OK: 7.48 GB (15692853 sectors)
Data LOST: 23.75 GB (49808460 sectors)
	       Corrupted: 23.75 GB (49808460 sectors)
	Slightly changed: 0.00 Byte (0 sectors)
	     Overwritten: 0.00 Byte (0 sectors)
Average reading speed: 0.00 Byte/s
$

 

유용한 내용이었으면 하트모양 공감을 눌러주세요!

[리눅스] The following packages have been kept back 원인과 해결 방법

 

우분투에서 sudo apt-get upgrade 실행 시 다음과 같은 메시지가 나오면서 업그레이드가 안 되는 경우가 종종 있습니다.

$ sudo apt-get upgrade

The following packages have been kept back:
  dkms ubuntu-advantage-tools
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

$

 

이는 기존에 설치되어 있던 프로그램 중에서 의존성이 변경된 경우가 있어서 업그레이드를 위해서는 기존에 컴퓨터에 설치되어 있지 않던 프로그램을 새로 설치해야 할 경우에 나타나는 경고 메시지입니다. 위 예제의 경우 dkmsubuntu-advantage-tools를 업그레이드 하기 위해서는 기존에 없던 프로그램들을 새로 설치해야 하기 때문에 경고만 해 주고 업그레이드를 실행하지 않은 것입니다.

 

이런 경우 새롭게 필요한 프로그램들을 추가로 설치하면서 apt-get upgrade를 실행하려면 다음과 같이 --with-new-pkgs 옵션을 주면 됩니다. 말 그대로 '새로운 패키지와 함께 (with new packages)' 업그레이드를 진행하라는 옵션입니다. 해당 옵션을 주었더니 새롭게 dctrl-toolsubuntu-pro-client-l10n 두 종류의 프로그램을 설치하면서 dkmsubuntu-advantage-tools를 업그레이드하는 것을 볼 수 있습니다.

$ sudo apt-get --with-new-pkgs upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  dctrl-tools ubuntu-pro-client-l10n
The following packages will be upgraded:
  dkms ubuntu-advantage-tools
2 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 349 kB of archives.
After this operation, 590 kB of additional disk space will be used.
Do you want to continue? [Y/n]

$

 

한편 이렇게까지 해도 안 되는 경우가 있다면 다음과 같이 aptitude를 설치하신 후에 aptitude를 통해 업그레이드를 진행하는 방법도 있습니다. 하지만 대부분 여기까지 오지 않아도 위의 방법으로 해결이 될 것입니다.

$ sudo apt-get install aptitude -y
$ sudo aptitude safe-upgrade

+ Recent posts