揮発性のメモ2

知識をメモ書きしておく

スーパーブロックの修復

壊れたSDのイメージを吸い出して、同じくらいのサイズの別SDに丸コピーして調査を

# fsck -n /dev/sda2
fsck from util-linux 2.29.2
e2fsck 1.43.4 (31-Jan-2017)
Warning: skipping journal recovery because doing a read-only filesystem check.
The filesystem size (according to the superblock) is 221688 blocks
The physical size of the device is 220664 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort? no

/dev/sda2 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda2: 18/55440 files (0.0% non-contiguous), 7843/221688 blocks

スーパーブロックが壊れてるとか言われたときは、ちゃんとした修復はできないのであきらめて適当な修復をおこなう

# mke2fs -S /dev/sdb2                                          
mke2fs 1.43.4 (31-Jan-2017)                                                     
/dev/sdb2 contains a ext3 file system                                           
        last mounted on Sat Jan  1 00:00:08 2000                                
Proceed anyway? (y,N) y                                                         
Creating filesystem with 220664 4k blocks and 55216 inodes                      
Filesystem UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx                           
Superblock backups stored on blocks:                                            
        32768, 98304, 163840                                                    
                                                                                
Allocating group tables: done                                                   
/dev/sdb2 may be further corrupted by superblock rewrite                        
Proceed anyway? (y,N) y                                                         
Writing superblocks and filesystem accounting information: done                 
# fsck -y /dev/sdb2                                            
fsck from util-linux 2.29.2                                                     
e2fsck 1.43.4 (31-Jan-2017)                                                     
/dev/sdb2 contains a file system with errors, check forced.                     
Resize inode not valid.  Recreate? yes                                          
                                                                                
Pass 1: Checking inodes, blocks, and sizes                                      
The bad block inode looks invalid.  Clear? yes                                  
                                                                                
Root inode is not a directory.  Clear? yes                                      
後略

致命的そうな大量のエラーが景気良く直っていくので、諦観して待つ

大事なファイルを lost+found から拾って終わり


linuxjm.osdn.jp

ファイルをぜんぶコピーする

ルートファイルシステムの全ファイルを USBメモリとかにコピーしたい。
でもそのままだと /proc だの /sys だのまでコピーされるので、ファイルシステムをまたがないオプション -x を使う。

cp -ax /. /mnt/

/. の . は別に要らないけど、気分の問題なので付ける。
/* だとダメ。 それぞれ独立したコピーになるので、結局 /proc などがファイルシステムをまたがないことになる

システムトイレ用猫砂 3

花王ニャンとも清潔トイレ チップ大きめは1リットル当たり約226
システムトイレ用チップの中でも普通の価格だけど、うちはガンガン砂を交換するスタイルなので、もっと安いのを探したところ
クリーンミュウ システムトイレ用 国産天然ひのきのチップ
がほぼニャンともと同じで値段が半分なので、これになった。
今のところ猫は嫌がっていないので、当分これでいく。

ChromeでのBASIC認証の挙動

URLにBASIC認証のIDとパスワードを埋め込む形式
http://username:password@192.168.0.2/
は、Chromeでは機能せず、普通にIDとパスワードを聞いてくる。

動かないのは多分セキュリティ上わざとだよなと思いつつも
いつからナンデ動かなくなったのか気になって仕方ないので
調べたところ、2年前に削られたらしい

Chrome 59以降 でBasic認証を埋め込んだURLが正しく表示されない - IT漂着メモ
www.chromestatus.com

簡便さと安全性はいつだってトレードオフ

RTO_MINの変更

serverfault.com
ipコマンドで変更可能らしい

# ip route show
default via 172.16.0.1 dev enp0s3 onlink
172.16.0.0/16 dev enp0s3 proto kernel scope link src 172.16.101.57
# ip route change 172.16.0.0/16 dev enp0s3 rto_min 3s
# ip route show
default via 172.16.0.1 dev enp0s3 onlink
172.16.0.0/16 dev enp0s3 scope link  rto_min lock 3s

初期値を見る手段がよくわからない上に、初期値に戻す手段もよくわからない
(初期値は0.2秒らしいので一応戻すことはできるっぽい)