今天一上班,收到一条来自火线的工单~
判断OS的Host是虚拟机还是物理机
1 | [root@pearl-cw01 ~]# dmidecode -s system-product-name |
linux磁盘分区文件系统filesystem损坏后修复
openstack中把volume detach掉后,重新attach回来会有一定概率导致分区无法挂载,手动mount一下后会发现报错filesystem无法识别。
表象可能是lsblk和df显示的磁盘大小不一致。主动指明成ext4后再次mount后,仍然会是失败,这个时候就需要手动恢复一下filesystem了。
先把磁盘去掉挂载, 以下均以/dev/vdb为例
1
# unmount /dev/vdb
如果失败,则修改/etc/fstab里的记录,注释掉挂载,然后重启OS。
用fsck检查磁盘
1
2
3
4
5
6
7
8# e2fsck /dev/vdb
e2fsck 1.41.12 (17-May-2010)
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 sumary information
ext4-1:11/131072 files (0.0% non-contiguous),27050/524128 blocks用resize2fs重新恢复一次磁盘filesystem
1
2
3
4# resize2fs /dev/vdb
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/vdb to 524128 (1k) blocks.
The filesystem on /dev/vdb is now 524128 blocks long.再次mount回来,检查文件。
1
# mount /dev/vdb /data0
一个专门分享One Page Websites的网站
给朋友要做一个简单的企业的展示站,想找一个单页的响应式源码,转了老半天,也没看到国内有免费的可以用。
最后发现下面这个站,还挺好的,Mark一下。
选了一个比较简单的,改动后的效果 http://www.greenwater.tech
转到HEXO了
Jekyll安装主题太麻烦,也许是没找到路子。
Jekyll依赖的Ruby的环境在我本地始终没有配置成功,尝试了好几遍,弃了。
决定试探一下HEXO,基于npm安装的,主题安装比较容易,改起来也挺简单。
唯一的遗憾是Jekyll全部代码push到github,github是可以自动编译的,但是HEXO需要在本地产生静态代码,然后把所有的静态代码push到github里去。
但是整体的效果还是挺满意的,换了。
水面的鸭子
安静平和的生活,需要处处暗自努力。
就像水面的鸭子,看似悠然自得,其实水下小腿紧倒腾!
python编译为pyc
1 | #递归编译当前目录下的所有code为pyc,-b表示在原位置生成,不放到pycache里 |
bash 快捷键
突然发现bash提供的快捷键也是非常的好用,整理一下。
检查磁盘的IO性能是否能匹配ETCD的需求
https://www.ibm.com/cloud/blog/using-fio-to-tell-whether-your-storage-is-fast-enough-for-etcd
1 | # mkdir test-data |
All you have to do then is look at the output and check if the 99th percentile of fdatasync durations is less than 10ms. If that is the case, then your storage is fast enough. Here is an example output:
主要是看fsync/fdatasync/sync_file_range的结果,单位是毫秒,如果99.00%的少于10毫秒,就说明这个disk是没问题,反之容易引起ETCD读写的问题。