- èæ¯
- ç®ç
- å®è¡ç°å¢
- å®é¨æ¦è¦
- å®é¨æºå
- å®é¨æé
- å®é¨çµæ
- èå¯
- ã¾ã¨ã
- å¤æ´å±¥æ´
- åèæç®
èæ¯
USB(Universal Serial Bus) ã¯ãããã¤ã¹å士ãæ¥ç¶ããããã®ã·ãªã¢ã«ãã¹è¦æ ¼ã®1ã¤ã§ãããã¹ãã¬ã¼ã¸ããã¤ã¹ãå ¥åããã¤ã¹ãéä¿¡æ©å¨ããã«ãã¡ãã£ã¢æ©å¨ãªã©ãå¤å²ã«ãããç¨éã§å©ç¨ããã¦ããã
ãã®æ軽ããæ±ç¨æ§ã®é«ããããè¿å¹´ã§ã¯å®¶åºç¨ãæ¥åç¨ã®ã³ã³ãã¥ã¼ã¿ã ãã§ãªããçµã¿è¾¼ã¿ã·ã¹ãã ãIoTããã¤ã¹ã«ãæ¡ç¨ããã¦ãããä¸æ¹ã§ãUSBããã¤ã¹ã«ã¯ä»¥ä¸ã®ãããªåé¡ãçºçããå¯è½æ§ãããã
- æå³ããªãåæ
- é»åä¾çµ¦ä¸è¶³
- ã½ããã¦ã§ã¢ã®ä¸å ·å
ãããã®åé¡ã¯åæ¿å ¥ããªã»ããã§å¾©æ§å¯è½ãªå ´åãå¤ãããUSBã¹ãã¬ã¼ã¸ããã¤ã¹ã§ã¯ãã¼ã¿æ失ã®ãªã¹ã¯ãé«ã¾ãã ãã ããUSBã¹ãã¬ã¼ã¸ããã¤ã¹ã®ãããªä¸æ®çºæ§ã¡ã¢ãªã使ç¨ãã¦ããå ´åã復æ§ãé£ãããªããã¨ãããã
ä¾ãã°ãUSBã¹ãã¬ã¼ã¸ããã¤ã¹ããã¡ã¤ã«ã·ã¹ãã ã«æ¸ãè¾¼ãã§ããæä¸ã«åæããã¨ã以ä¸ã®ãããªåé¡ãçºçããæããããã
- æ¸ãè¾¼ã¿ä¸ã®ãã¼ã¿æ失
- ãã¡ã¤ã«ã·ã¹ãã ã®ç ´æ
- ã·ã¹ãã ã¯ã©ãã·ã¥ãäºæããªãåä½
ãããã®åé¡ãæªç¶ã«é²ãããã«ã¯ãUSBããã¤ã¹ã®ä¸æã®åæãåæ¥ç¶ã«ãããªã¹ã¯ãç解ãããããèæ ®ããã½ããã¦ã§ã¢è¨è¨ãå¿ è¦ã§ããã æ¬è¨äºã§ã¯ãRaspberry Pi 4ã使ç¨ãã¦USBã¹ãã¬ã¼ã¸ããã¤ã¹ã対象ã¨ããå¼·å¶æ¿æãã¹ããå®æ½ãããã®å½±é¿ãè©ä¾¡ããã
ç®ç
æ¬è¨äºã§ã¯ãRaspberry Pi 4ã«æ¥ç¶ãããUSBãã©ãã·ã¥ãã©ã¤ãã対象ã«å¼·å¶æ¿æãã¹ããè¡ãã以ä¸ã®3ã¤ã®è¦³ç¹ããã·ã¹ãã ã¸ã®å½±é¿ã確èªããã
- ã·ã¹ãã ã®å¾©æ§æ§: ããã¤ã¹ãåæ¥ç¶å¾ãã·ã¹ãã ãæ£å¸¸ã«èªèããåä½ãåéã§ããã
- ãã¡ã¤ã«ã·ã¹ãã ã®å¾©æ§æ§: ããã¤ã¹ãåæ¥ç¶å¾ããã¡ã¤ã«ã·ã¹ãã ãå©ç¨å¯è½ãªç¶æ ã§ããã
- ãã¼ã¿ã®å¾©æ§æ§: ãã¡ã¤ã«ã·ã¹ãã å ã®ãã¡ã¤ã«ããã£ã¬ã¯ããªãååã§ããã
ããã«ãããLinuxã·ã¹ãã ã«ãããUSBããã¤ã¹ã®å¼·å¶æ¿æãªã¹ã¯ãç解ããå®å ¨æ§ã¨ä¿¡é ¼æ§ãåä¸ãããããã®éç¨è¨è¨ã®æéãæä¾ãããã¨ãç®æããã
å®è¡ç°å¢
Raspberry Pi 4ã¯microSDã«ã¼ãçµç±ã§Raspberry Pi OSãèµ·åããã è©ä¾¡å¯¾è±¡ã®USBãã©ãã·ã¥ãã©ã¤ãã¯USB 3.0ãã¼ãã«æ¥ç¶ããã
以ä¸ã«ã使ç¨ããRaspberry Pi 4ã¨é¢é£ã³ã³ãã¼ãã³ãã®ã¹ããã¯ã示ãã
é ç® | Raspberry Pi 4 |
---|---|
CPU | Cortex-A72 (ARM v8) 1.5GHz |
ã¡ã¢ãª | 4GB LPDDR4-3200 |
micro SD card | KTHN-MW016G |
OS | Raspberry Pi OS (Oct 22nd 2024) |
Linux kernel | 6.6.51 |
fsck.vfat | dosfstools 4.2 |
fsstress | ltp@ec41611 |
USB 3.0 (1) | USM32GU |
ãã¡ã¤ã«ã·ã¹ãã | FAT32 |
å®é¨æ¦è¦
Raspberry Pi 4ã«æ¥ç¶ããUSBã¹ãã¬ã¼ã¸ããã¤ã¹ã¸ã®ãã¡ã¤ã«æ¸ãè¾¼ã¿ä¸ã«å¼·å¶æå»ãããã®ã¨ãã®ã¹ãã¬ã¼ã¸ç¶æ ããã·ã¹ãã ã¸ã®å½±é¿ãè©ä¾¡ããã
以ä¸ã«ãä»åã®å®é¨ã§ãã¤ã³ãã¨ãªãè¦ç´ ãæããã
- USBããã¤ã¹ã®è«ççãªæ¿æ: ç©ççãªè² æ ãé¿ãããããã½ããã¦ã§ã¢ã¬ãã«ã§USBããã¤ã¹ã®æ¥ç¶ãåæãã·ãã¥ã¬ã¼ãããã
- è² è·ããã°ã©ã :
ãã¡ã¤ã«ã·ã¹ãã ã«å¯¾ããã©ã³ãã ãªæä½ãã·ãã¥ã¬ã¼ãããããã
fsstress
ã使ç¨ããã - ã·ã¹ãã ã¸ã®å½±é¿åº¦ã®è©ä¾¡æ¹æ³: ã·ã¹ãã ã®ç¶æ ã5段éã«åé¡ããããããã®å½±é¿ãè©ä¾¡ããã
USBããã¤ã¹ã®è«ççãªæ¿æ
ç©ççãªæãå·®ãã¯ããã¤ã¹ããã¼ãã«è² æ ãä¸ãããããLinuxã®USBãµãã·ã¹ãã ãå©ç¨ãã¦è«ççã«æ¿æãã·ãã¥ã¬ã¼ãããã ä»åã®å®é¨ã§ã¯ãUSBããã¤ã¹ãé »ç¹ã«æ¿æããå¿ è¦ãããã ããããããããã¹ã¦æä½æ¥ã§è¡ãã®ã¯éç¾å®çã§ãããããã¤ã¹ããã¼ãã¸ã®ç©ççãªè² æ ãæ¸å¿µãããã ããã§ãå®éã«USBããã¤ã¹ãç©ççã«æãå·®ãããã®ã§ã¯ãªããã½ããã¦ã§ã¢ã¬ãã«ã§æ¿æãã·ãã¥ã¬ã¼ãããæ¹æ³ãç¨ããã
Linuxã®USBãµãã·ã¹ãã ã§ã¯ãUSBããã¤ã¹ãæ¤åºãããã¨ãèªåçã«é©åãªãã©ã¤ãã«ãã¤ã³ã(bind)ãããLinuxããæä½å¯è½ãªç¶æ ã«ã»ããã¢ãããããã ä¸æ¹ãLinuxã§ã¯ã¦ã¼ã¶ç©ºéããç¹å®ã®USBããã¤ã¹ãæåã§ãã©ã¤ãã«ãã¤ã³ãããããéã«ã¢ã³ãã¤ã³ã(unbind)ããããããã¨ãã§ããã ãã®æä½ã«ãããUSBããã¤ã¹ãè«ççã«æ¿æ(æ¥ç¶ã¾ãã¯åæ) ãããããªå¶å¾¡ãã§ããã
以ä¸ã¯ãBus 1, Port 1, Config 1, Interface 2ã«æ¥ç¶ãããUSBããã¤ã¹ãæåã§ãã©ã¤ãã«ãã¤ã³ãããä¾ã§ããã
pi@raspberrypi:~$ echo -n "1-1:1.2" > /sys/bus/usb/drivers/usb/bind
次ã«ãåãããã¤ã¹ãæåã§ãã©ã¤ãããã¢ã³ãã¤ã³ãããä¾ã示ãã
pi@raspberrypi:~$ echo -n "1-1:1.2" > /sys/bus/usb/drivers/usb/unbind
è² è·ããã°ã©ã
ã¹ãã¬ã¼ã¸ã«ã©ã®ãããªãã¼ã¿ãä¿åãããããã®ãã¼ã¿ãã©ã®ããã«åãæ±ããã¯ã¦ã¼ã¶ã«ãã£ã¦ç°ãªãã ä»åã®å®é¨ã§ããã¹ã¦ã®ã¦ã¼ã¹ã±ã¼ã¹ãç¶²ç¾ ãããã¨ã¯ç¾å®çã§ãªããããè² è·ããã°ã©ã ãå©ç¨ãããã¨ã§ä»£ç¨ããã
fsstressã¯XFSãã¹ãã¹ã¤ã¼ãã¨ãã¦éçºããããã¡ã¤ã«ã·ã¹ãã è² è·ããã°ã©ã ã§ãããLinux Test Project (LTP) ã®ä¸é¨ã¨ãã¦æä¾ããã¦ããã ãã®ããã°ã©ã ã¯ããã¡ã¤ã«ã·ã¹ãã ã®èä¹ æ§ãä¿¡é ¼æ§ããã¹ãããããã«ããã¾ãã¾ãªãã¡ã¤ã«æä½ãã·ãã¥ã¬ã¼ããã¦è² è·ãããããã¼ã«ã§ããã å¤ãã®ãªãã·ã§ã³ãæä¾ããã¦ãããã¢ã¯ã»ã¹ãã¿ã¼ã³ãæä½åæ°ãªã©ãèªç±ã«èª¿æ´ã§ãããããåå¿è ã§ãç°¡åã«å©ç¨ã§ããã®ãç¹å¾´ã§ããã
Raspberry Pi 4 ã§ã¯4ã¤ã®ã³ã¢ãæã¤ãããããã»ã¹ã4ã¤çæãã¦è² è·ããã°ã©ã ããããã
以ä¸ã¯ããã£ã¬ã¯ããª/mnt/test
ã«å¯¾ãã¦ã4ã¤ã®ããã»ã¹ã並åãã¦ã©ã³ãã ãªãã¡ã¤ã«æä½ãè¡ãä¾ã§ããã
pi@raspberrypi:~$ fsstress -p 4 -z -n 1000 -d /mnt/test
ã·ã¹ãã ã¸ã®å½±é¿åº¦ã®è©ä¾¡æ¹æ³
ãã¼ã¿ã®éè¦æ§ãæ±ãæ¹ã¯ã¦ã¼ã¶ã«ãã£ã¦ç°ãªããããã·ã¹ãã ç ´æç¶æ ã®æ·±å»åº¦ãå®éçã«æ¸¬å®ãããã¨ã¯ã§ããªãã ããã§ãä»åã®å®é¨ã§ã¯æ¬¡ã®5ã¤ã®ç¶æ ãç¬èªã«å®ç¾©ããããããã®ç¶æ ããã·ã¹ãã ã¸ã®å½±é¿åº¦ãè©ä¾¡ããã
- è´å½çãªã¨ã©ã¼(Fatal Error): ããã¤ã¹ãç©ççã¾ãã¯è«ççã«é大ãªç ´æãåããã·ã¹ãã ããå®å ¨ã«èªèãããªããªãç¶æ
- é大ãªã¨ã©ã¼(Serious Error): ããã¤ã¹ä¸ã®ãã¡ã¤ã«ã·ã¹ãã ããã¦ã³ãã§ããªããªããããç ´æãã¦ãã¾ã£ãç¶æ
- ä¸åº¦ãªã¨ã©ã¼(Moderate Error): ããã¤ã¹ä¸ã®ãã¡ã¤ã«ã·ã¹ãã ã«ããä¸é¨ã®ãã¡ã¤ã«ããã£ã¬ã¯ããªãèªã¿åãã§ããªããªã£ãç¶æ
- 軽度ãªã¨ã©ã¼(Mild Error): ãã¡ã¤ã«ã·ã¹ãã å ã®ãã¡ã¤ã«ããã£ã¬ã¯ããªããã¹ã¦èªã¿åãå¯è½ã§ãããã®ã®ãä¸é¨ã®ãã¡ã¤ã«ãæ£ããåä½ããªãããããã¯ãã¡ã¤ã«åãå 容ãç ´æãã¦ããç¶æ ã
- åé¡ãªã(Fine): fsck.vfatã«ããæ´åæ§ãã§ãã¯ã§åé¡ãªãã¨ç¢ºèªãããç¶æ
ããããã®ç¶æ ãå¤æããéã«ä½¿ç¨ããå ·ä½çãªæé ã¯ä»¥ä¸ã®éãã§ããã
ããã¤ã¹ã®èªè確èª: 次ã®ã³ãã³ãã§ããã¤ã¹ãã¡ã¤ã«ã®åå¨ã確èªããã
pi@raspberrypi:~$ test -e /dev/sda
ãã¡ã¤ã«ã·ã¹ãã ã®ãã¦ã³ã確èª: èªã¿åãå°ç¨ã§ãã¦ã³ãã試ã¿ãã
pi@raspberrypi:~$ mount -o ro /dev/sda /mnt
ãã¡ã¤ã«ããã£ã¬ã¯ããªã®èªã¿åã確èª: ãã¡ã¤ã«ã·ã¹ãã å ã®å ¨ãã¡ã¤ã«ã¨ãã£ã¬ã¯ããªãå帰çã«èªã¿åãã
pi@raspberrypi:~$ ls -laR /mnt pi@raspberrypi:~$ find /mnt -type f -exec cat {} +
ãã¡ã¤ã«ã·ã¹ãã ã®æ´åæ§ç¢ºèª: fsck.vfatã³ãã³ãã使ç¨ããããã®éãFATãã¡ã¤ã«ã·ã¹ãã ãè¨å®ããdirty volume flagsã«é¢ããæ å ±ã¯ç¡è¦ãããã®ã¨ããã以ä¸ã¯å ·ä½ä¾ã§ããã
pi@raspberrypi:~$ fsck.vfat -n /dev/sda There are differences between boot sector and its backup. This is mostly harmless. Differences: (offset:original/backup) 65:01/00 Not automatically fixing this. Dirty bit is set. Fs was not properly unmounted and some data may be corrupt. Automatically removing dirty bit.
å®é¨æºå
å®é¨ãå®æ½ããããã«ã以ä¸ã®æé ã§ç°å¢ãæ´åããã
ãµã³ãã«ããã°ã©ã ã®ãã«ã
éçºãã·ã³ã§LTP(Linux Test Project) ã®ãã«ããè¡ããfsstress
ãRaspberry Pi 4ä¸ã§å®è¡å¯è½ã«ããã
éçºãã·ã³ã«LTPã®ãã«ãã«å¿ è¦ãªããã±ã¼ã¸ã¨ AArch64ç¨ã®ã¯ãã¹ã³ã³ãã¤ã©ãã¤ã³ã¹ãã¼ã«ãã
user@builder:~$ sudo apt install gcc git make pkgconf autoconf automake bison flex m4 linux-headers-$(uname -r) user@builder:~$ sudo apt install libc6-dev crossbuild-essential-arm64
éçºãã·ã³ã«LTPããã¦ã³ãã¼ãããAArch64ç¨ã®ãã«ãã®è¨å®ãã
user@builder:~$ git clone --recurse-submodules https://github.com/linux-test-project/ltp.git user@builder:~$ cd ltp user@builder:~$ make autotools user@builder:~/ltp$ ./configure --host=aarch64-linux-gnu
éçºãã·ã³ã§fsstressããã«ããã
user@builder:~/ltp$ cd testcases/kernel/fs/fsstress user@builder:~/ltp/testcases/kernel/fs/fsstress$ make
ãã«ãææç©ã® fsstress
ããRaspberry Pi 4 ã® /usr/local/bin
ã«ã³ãã¼ããã
USBããã¤ã¹ã®æ¥ç¶
USBãã©ãã·ã¥ãã©ã¤ããRaspberry Pi 4ã«æ¥ç¶ããã 以ä¸ã®ã³ãã³ãã§æ¥ç¶ç¶æ ã確èªããã¢ãã¬ã¹æ å ±ãåå¾ããã
Raspberry Pi 4 ã«USBãã©ãã·ã¥ãã©ã¤ããæ¥ç¶ãã
pi@raspberrypi:~$ lsusb -t /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
USBãã©ãã·ã¥ãã©ã¤ãã¯ãBus 2, Port 1 ã®USBããã«ç¹ãã£ã¦ãããã¨ã確èªã§ããã
ãããã®å¤ã¯ãã®å¾ã«ä½¿ç¨ãããããã·ã§ã«å¤æ°USB_ADDR
ã«ä»£å
¥ãã¦ãã
pi@raspberrypi:~$ USB_ADDR=$(dmesg | awk '/usb [0-9]+-[0-9]+:/ && /Product: Storage Media/ {sub(/.*usb /, ""); sub(/:.*/, ""); print; exit}')
ã¾ãããã®USBãã©ãã·ã¥ãã©ã¤ãã®ãããã¯ããã¤ã¹ãã¡ã¤ã«ãã·ã§ã«å¤æ°DEVICE_FILE
ã«ä»£å
¥ãã¦ããã
pi@raspberrypi:~$ DEVICE_FILE=$(readlink -f /dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1:1.0-scsi-0:0:0:0)
å®é¨æé
ãã¦ã³ããã¤ã³ãç¨ã®ãã³ãã©ãªãã£ã¬ã¯ããªãä½æãã
TMPDIR="$(mktemp -d)"
ã¹ãã¬ã¼ã¸ããã¤ã¹ãFAT32ãã¡ã¤ã«ã·ã¹ãã ã§åæåãã
mkfs.vfat ${DEVICE_FILE}
FAT32ãã©ãã·ã¥ãã©ã¤ãã§ãã©ã¼ããããããUSBãã©ãã·ã¥ãã©ã¤ãããã¦ã³ããã
mount -t vfat ${MNTOPT} ${DEVICE_FILE} ${TMPDIR}
ãã¹ãç¨ã®ãã£ã¬ã¯ããªãä½æãã¦ãã
mkdir ${TMPDIR}/test; sync
è² è·ããã°ã©ã ãããã°ã°ã©ã¦ã³ãããã»ã¹ã¨ãã¦å®è¡ããã
fsstress -p 4 -z -n 1000 -d ${TMPDIR}/test &
ã©ã³ãã ãªæé(0ã59ç§) çµéå¾ã«ãUSBããã¤ã¹ãå¼·å¶æå»ãã
sleep $((RANDOM % 60)); echo -n ${USB_ADDR} > /sys/bus/usb/drivers/usb/unbind
è² è·ããã°ã©ã ãçµäºããã
pkill -9 fsstress
ãã¦ã³ãããã¦ããFAT32ãã¡ã¤ã«ã·ã¹ãã ãã¢ã³ãã¦ã³ããã
umount ${TMPDIR}
USBããã¤ã¹ãå度ãæ¿å ¥ãã
echo -n ${USB_ADDR} > /sys/bus/usb/drivers/usb/bind
USBãã©ãã·ã¥ãã©ã¤ãä¸ã®ãã¡ã¤ã«ã·ã¹ãã ç¶æ ã確èªãã
fsck.vfat -n ${DEVICE_FILE} mount -o ro ${DEVICE_FILE} ${TMPDIR} ls -lAR ${TMPDIR} find ${TMPDIR} -type f -exec cat {} + umount ${DEVICE_FILE}
å®é¨çµæ
æ¬å®é¨ã§ã¯ããã¦ã³ããªãã·ã§ã³(${MNTOPT}
) ã -o defaults
㨠-o sync
ã®2種é¡ã§è¨å®ãããããã1000åã®å¼·å¶æå»ãã¹ããå®æ½ããã
ã·ã¹ãã ã¸ã®å½±é¿åº¦ã¯ ãå®é¨æ¦è¦ã ã§ç¤ºãã5段é(è´å½çãªã¨ã©ã¼ãé大ãªã¨ã©ã¼ãä¸åº¦ãªã¨ã©ã¼ã軽度ãªã¨ã©ã¼ãåé¡ãªã) ã«åºã¥ãã¦åé¡ããã
以ä¸ã®ã°ã©ãã¯ãå¼·å¶æå»ã¾ã§ã®æé(横軸)ã¨ã·ã¹ãã ã¸ã®å½±é¿åº¦ã®çºçåæ°(縦軸)ã示ãã¦ããã-o defaults
ã¨-o sync
ã®çµæãæ¯è¼ããã
ããã©ã«ãã®çµæ
ä¸åº¦ãªã¨ã©ã¼(Moderate Error) ãã¡ã¤ã«ããã£ã¬ã¯ããªãæ£å¸¸ã«èªããªããªãã±ã¼ã¹ãå¤çºããå ¨ä½ã®ç´80ï¼ ãå ããã
軽度ãªã¨ã©ã¼(Mild Error) å¼·å¶æå»ã¾ã§ã®æéãçã(5ç§æªæº)å ´åã«å¤ãçºçããå ¨ä½ã®ç´15ï¼ ãå ããã
åé¡ãªã(Fine) åé¡ãªãã¨å¤å®ãããã±ã¼ã¹ã¯é常ã«å°ãªããå ¨ä½ã®ç´5ï¼ ã«çã¾ã£ãã
syncãªãã·ã§ã³ã®çµæ
ä¸åº¦ãªã¨ã©ã¼(Moderate Error)
ç¨ã«çºçããå ¨ä½ã®ç´0.2ï¼ ã«çã¾ã£ãã軽度ãªã¨ã©ã¼(Mild Error)
ãã¡ã¤ã«ããã£ã¬ã¯ããªãæ£å¸¸ã«èªã¿åãå¯è½ãªã±ã¼ã¹ãæ¯é çã§ãããå ¨ä½ã®ç´98ï¼ ãå ãããåé¡ãªã(Fine)
åé¡ãªãã¨å¤å®ãããã±ã¼ã¹ã¯å ¨ä½ã®ç´1ï¼ ã«çã¾ã£ãã
èå¯
Linuxã§ã¯ããã¡ã¤ã«ã¸ã®æ¸ãè¾¼ã¿ã«writebackæ¹å¼ãæ¡ç¨ããã¦ããã writebackæ¹å¼ã§ã¯ãã¢ããªã±ã¼ã·ã§ã³ããã®æ¸ãè¾¼ã¿è¦æ±ãå³åº§ã«ã¹ãã¬ã¼ã¸ã¸åæ ãããããã§ã¯ãªããä¸æçã«ã«ã¼ãã«ã®ãã¼ã¸ãã£ãã·ã¥ã«èãããããã®å¾é©åãªã¿ã¤ãã³ã°ã§ã¾ã¨ãã¦ãã£ã¹ã¯ã¸åæ ãããã ãã®æ¹å¼ã¯ã·ã¹ãã æ§è½ã®åä¸ã«å¯ä¸ããä¸æ¹ã§ãã·ã¹ãã ã®ç°å¸¸çµäºãããã¤ã¹ã®å¼·å¶æå»ã¨ãã£ãäºæããªãç¶æ³ä¸ã§ã¯ãªã¹ã¯ãä¼´ãã
ç¹ã«ã以ä¸ã®åé¡ãçããå¯è½æ§ãããã
- ãã¼ã¿ã®ãã£ãã·ã¥æ®å: æ¸ãè¾¼ã¿ãã¼ã¿ããã£ãã·ã¥ã«æ®ã£ãã¾ã¾ã¹ãã¬ã¼ã¸ã«åæ ãããªãå ´åããã¼ã¿æ失ãçºçããã
- ã¡ã¿ãã¼ã¿ã®ä¸å®å ¨æ´æ°: ãã¡ã¤ã«ã·ã¹ãã ã®ã¡ã¿ãã¼ã¿æ´æ°ãæªå®äºã®ç¶æ ã§æå»ãè¡ãããã¨ããã¡ã¤ã«ã·ã¹ãã å ¨ä½ã®ä¸æ´åãæãã
writebackæ¹å¼ã®ç¹å¾´ã¨ãã¦ããã¼ã¿ããã£ãã·ã¥ã«ã¨ã©ã¾ã£ãã¾ã¾ã¹ãã¬ã¼ã¸ã«åæ ãããªãå ´åããã¼ã¿æ失ãçºçãããã¨ããããã¾ãããã¡ã¤ã«ã·ã¹ãã ã®ã¡ã¿ãã¼ã¿æ´æ°ãæªå®äºã®ç¶æ ã§æå»ãè¡ãããã¨ããã¡ã¤ã«ã·ã¹ãã å ¨ä½ã®ä¸æ´åãæãå¯è½æ§ãé«ãã
FAT32ãã¡ã¤ã«ã·ã¹ãã ã®ç¹æ§ãªã¹ã¯
æ¬å®é¨ã§ä½¿ç¨ããFAT32ãã¡ã¤ã«ã·ã¹ãã ã¯ã以ä¸ã®3ã¤ã®é åã§æ§æããã¦ããã
- Reserved Region: ãã¡ã¤ã«ã·ã¹ãã å ¨ä½ã®ã¡ã¿ãã¼ã¿ãæ ¼ç´
- FAT Region: ãã¡ã¤ã«ããã£ã¬ã¯ããªãå æããã¯ã©ã¹ã¿ã®ç¹ãã(ãã§ã¤ã³)ã管ç
- Data Region: ãã¡ã¤ã«ããã£ã¬ã¯ããªæ¬ä½ã®ãã¼ã¿ãå®éã«æ ¼ç´ãããé å
FAT32ãã¡ã¤ã«ã·ã¹ãã ã¯ã¸ã£ã¼ããªã³ã°æ©è½ã®ãããªæ©è½ãæããªããããã·ã¹ãã ã®ç°å¸¸çµäºãããã¤ã¹ã®å¼·å¶æå»ãçºçããå ´åã以ä¸ã®ãããªãªã¹ã¯ãçããã
- Reserved Regionã®ç ´æ: ãã¡ã¤ã«ã·ã¹ãã å ¨ä½ããã¦ã³ãä¸è½ã«ãªãé大ãªã¨ã©ã¼ãå¼ãèµ·ããã
- FAT Regionã®ç ´æ: ä¸é¨ã¾ãã¯å ¨ã¦ã®ãã¡ã¤ã«ããã£ã¬ã¯ããªãè¦ããªããªãã
- Data Regionã®ç ´æ: ãã¡ã¤ã«ã®å 容ãç ´æããèªã¿åãä¸è½ã«ãªãã
ãããã®é åãæã¤å½¹å²ã®ãããããæ´æ°éä¸ã§åæ¢ããã¨ãFAT32ãã¡ã¤ã«ã·ã¹ãã å ¨ä½ã«æ·±å»ãªå½±é¿ãåã¼ãå¯è½æ§ãé«ãã
syncãªãã·ã§ã³ã¨ä¸åº¦ãªã¨ã©ã¼
Linuxã®VFATãã¡ã¤ã«ã·ã¹ãã ã§-o syncãªãã·ã§ã³ãæå®ãããã¨ã§ããã¼ã¿ãå³åº§ã«ã¹ãã¬ã¼ã¸ã«åæ ããããããwritebackæ¹å¼ã«ãããã£ãã·ã¥æ®åãªã¹ã¯ãä½æ¸ã§ããã
ããããåæI/Oã§ãã£ã¦ãæ¸ãè¾¼ã¿æä½ãã¢ãããã¯ã§ã¯ãªããããå¼·å¶æå»ã®ã¿ã¤ãã³ã°ã«ãã£ã¦ã¯ä»¥ä¸ã®åé¡ãçºçããã
éã¢ãããã¯æ§ã«ããä¸æ´å
FAT Region ã Data Region ã®æ´æ°ãéä¸ã§åæ¢ããå ´åããã¼ã¿ãã¯ã©ã¹ã¿ãã§ã¤ã³ãä¸å®å ¨ãªç¶æ ã§ä¿åãããã ãã®ãããä¸é¨ã®ãã¡ã¤ã«ããã£ã¬ã¯ããªãæ£å¸¸ã«ã¢ã¯ã»ã¹ã§ããªããªãä¸åº¦ãªã¨ã©ã¼ãçºçããã
ããã¤ã¹åºæã®ç¹æ§
使ç¨ãã¦ããã¹ãã¬ã¼ã¸ããã¤ã¹ã®å é¨ãã£ãã·ã¥æ©è½ããæ©èã«ããæ¸ãè¾¼ã¿ã»ã«ã®å£åãã¨ã©ã¼ã®ä¸å ã¨ãªãã ç¹ã«ãä»æ§éåãä½å質ã®ããã¤ã¹ã§ã¯ãOSãè¦æ±ããåææ¸ãè¾¼ã¿ãæ£ããå®è¡ãããªãå ´åãããã
é«è² è·ç°å¢ä¸ã§ã®ç«¶å
fsstress
ã®ãããªé«è² è·æä½ã並è¡å®è¡ãã¦ããç°å¢ã§ã¯ãè¤æ°ã®æ¸ãè¾¼ã¿å¦çã競åããä¸å®å ¨ãªæ´æ°ãçºçãããªã¹ã¯ãé«ã¾ã
ã¾ã¨ã
æ¬å®é¨ãéãã¦ãUSBã¹ãã¬ã¼ã¸ããã¤ã¹ã«ãããç°å¸¸æå»ãªã¹ã¯ã«å¯¾ããæ·±ãç解ãå¾ãããã
-o sync
ãªãã·ã§ã³ã¯ä¿¡é ¼æ§ãåä¸ãããæå¹ãªæ段ã§ããããå®å
¨ãªå®å
¨æ§ãä¿è¨¼ãããã®ã§ã¯ãªãã
ãã®ãããèé害æ§ãæ±ããããã·ã¹ãã ã§ã¯ãã¸ã£ã¼ããªã³ã°ãªã©ã®æ©è½ãæã¤ãã¡ã¤ã«ã·ã¹ãã ã®æ¡ç¨ããé«å質ãªããã¤ã¹ã®å©ç¨ãæ¨å¥¨ãããã¾ããéç¨ããªã·ã¼ã®è¦ç´ããããã¯ã¢ããä½å¶ã®å¼·åãä¸å¯æ¬ ã§ããã
å¤æ´å±¥æ´
- 2024/12/12: è¨äºå ¬é