debian7.8中的一些常用配置

来源:互联网 发布:vb.net 字符串包含 编辑:程序博客网 时间:2024/05/21 10:20

一 配置信息

apt-get源配置

vim /etc/apt/sources.list

deb http://mirrors.163.com/debian wheezy main non-free contribdeb-src http://mirrors.163.com/debian wheezy main non-free contribdeb http://mirrors.163.com/debian wheezy-updates main non-free contribdeb-src http://mirrors.163.com/debian wheezy-updates main non-free contribdeb http://security.debian.org/ wheezy/updates maindeb-src http://security.debian.org/ wheezy/updates main



二 查看硬盘使用时间

#安装megacli用于获取Device Id
echo "deb http://hwraid.le-vert.net/debian wheezy main" >> /etc/apt/sources.list
wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key |apt-key add -
apt-get update
apt-get install megacli
megacli -PDList -aALL | grep "Device Id"



#安装smartctl,for循环中的i变量使用上面获取到的Device Id范围
apt-get install smartmontools


#!/bin/bash
for((i=8;i<=44;i++))
do
    smartctl -a -d megaraid,$i /dev/sda | grep Power_On_Hours
done





0 0