0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

100円材料のケースだけど 爆速 m.2 ngffなラズパイ4

Last updated at Posted at 2020-05-11

ある方のページの部分コピペ

1.jpg


そこで m.2 SSD NGFF の登場です

11.jpg

cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=5e3da3da-01  /boot           vfat    defaults          0       2
/dev/sda2	      /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

として

hdparm -t /dev/sda2
/dev/sda2:
Timing buffered disk reads: 740 MB in 3.00 seconds = 246.63 MB/sec
古い16GBなngffのくせに なまじっかな 機械式ハードディスクより早い
但し 古いので後述の 普通のSSDより 残念ながら遅い。

なお 起動風景は
https://youtu.be/vdS5n8eRNIs


閑話休題

ヨビノリさんちょっとすごい
将棋に強くなるためには まず読む力が必要です

物理がわかるためには その言葉の数学が必要ですね

[素粒子+宇宙]   対 [物性] なのか
そういえば [素粒子+宇宙]は 超弦理論で扱ってますねー

1.png


男子3従の教え
幼い時は母に従い、結婚しては妻に従い、老いては娘に従う

この記事の技術的細部は以下をご覧ください


100円ショップの材料で組み立てました

1.jpg

2.jpg

3.jpg



ファンをとめると
pi@raspberrypi:~ $ ./ondo-cpu.bat
temp=60.0'C

ファンをつけると
pi@raspberrypi:~ $ ./ondo-cpu.bat
temp=44.0'C


なおこんなふうにもできます
11.jpg

これだとUSB接続機械式ハードディスクで

# hdparm -t /dev/sda2
/dev/sda2:
 Timing buffered disk reads: 294 MB in  3.01 seconds =  97.65 MB/sec
と遅いのですが

大容量です
# df
ファイルシス   1K-ブロック    使用    使用可 使用% マウント位置
/dev/root        302455420 8294600 278727228    3% /
devtmpfs            860900       0    860900    0% /dev
tmpfs               992996  198936    794060   21% /dev/shm
tmpfs               992996   16944    976052    2% /run
tmpfs                 5120       4      5116    1% /run/lock
tmpfs               992996       0    992996    0% /sys/fs/cgroup
/dev/mmcblk0p1      258095   53464    204631   21% /boot
tmpfs               198596       8    198588    1% /run/user/1000

またさらに 機械式のを SSDに変えると
# hdparm -t /dev/sda2
/dev/sda2:
 Timing buffered disk reads: 942 MB in  3.00 seconds = 313.61 MB/sec
これはいい感じ

duplicatorの一つにSSDをつけると バックアップも簡単だしねー



top

  • 19:23:13 up 5 min, 2 users, load average: 0.72, 0.42, 0.18
    Tasks: 157 total, 1 running, 156 sleeping, 0 stopped, 0 zombie
    %Cpu(s): 4.6 us, 3.7 sy, 0.0 ni, 91.6 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st
    MiB Mem : 1939.4 total, 1111.3 free, 318.6 used, 509.6 buff/cache
    MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 1376.1 avail Mem


バックアップは

1) SSDは ddとpartcloneで
ls Rpi4/SSD/
sdb1-vfat.pcl  sdb-5121600.img

2)USBは rsyncで
ls Rpi4/USB/
bin   dev  home  lost+found  mnt  proc  Rpi-Buster-SDcard---  sbin  sys  usr
boot  etc  lib   media       opt  root  run                   srv   tmp  var

やってます

libreoffice 削除(ngffが16GBしかないため)

aptitude search libreoffice | grep ^i

df

ファイルシス   1K-ブロック    使用  使用可 使用% マウント位置
/dev/root         13262188 7671208 4897576   62% /
devtmpfs            860900       0  860900    0% /dev
tmpfs               992996  143692  849304   15% /dev/shm
tmpfs               992996    8728  984268    1% /run
tmpfs                 5120       4    5116    1% /run/lock
tmpfs               992996       0  992996    0% /sys/fs/cgroup
/dev/mmcblk0p1      258095   53464  204632   21% /boot
tmpfs               198596       0  198596    0% /run/user/1000

aptitude install mplayer kate kolourpaint

youtube-dl

https://ytdl-org.github.io/youtube-dl/download.htmlのとおりに

wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
chmod a+rx /usr/local/bin/youtube-dl

印刷

apt install cups

root@raspberrypi:/home/pi# systemctl enable cups
Synchronizing state of cups.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable cups
root@raspberrypi:/home/pi# systemctl restart cups


ファイアーウォール UFW

**今の所**


cat ufw.bat 
--------------------
ufw default deny
ufw allow from 192.168.3.0/24
ufw allow Deluge
ufw limit ssh
ufw logging off



として
crontab -l
-------------------
@reboot /home/pi/ufw.bat


systemctl enable cron
Synchronizing state of cron.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable cron

最終型

お出かけ時は 16GB NGFFだけど 家にいるときは3.5インチハードディスクをデユプリケーターにつけて運用

111.jpeg

222.jpeg



# free
              total        used        free      shared  buff/cache   available
Mem:        1985996      884400      105100      335484      996496      662584
Swap:       4296628       13832     4282796



# ls -l /var/swap 
-rw------- 1 root root 104857600  5月 12 19:21 /var/swap



# ./comment-out.bat /etc/dphys-swapfile 
CONF_SWAPSIZE=100



# df
ファイルシス   1K-ブロック    使用    使用可 使用% マウント位置
/dev/root        148627104 8360232 132647296    6% /   <ーーー148GB
devtmpfs            860900       0    860900    0% /dev
tmpfs               992996  201164    791832   21% /dev/shm
tmpfs               992996   16936    976060    2% /run
tmpfs                 5120       4      5116    1% /run/lock
tmpfs               992996       0    992996    0% /sys/fs/cgroup
/dev/mmcblk0p1      258095   52148    205947   21% /boot
tmpfs               198596       8    198588    1% /run/user/1000



# fdisk -l /dev/sda
Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Disk model: 8AS             
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device     Boot   Start       End   Sectors  Size Id Type
/dev/sda2       8454016 312581807 304127792  145G 83 Linux
/dev/sda3         65536   8454014   8388479    4G 82 Linux swap / Solaris



# hdparm -t /dev/sda2
/dev/sda2:
 Timing buffered disk reads: 286 MB in  3.05 seconds =  93.85 MB/sec <ーーー機械式HDDなので



0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?