linux

All posts tagged linux

To check what is the HBA (firmware) version. root@server:/root# for host in `ls /sys/class/scsi_host/`; do cat /sys/class/scsi_host/${host}/fw_version 2>/dev/null; done 5.06.03 (90d5) 5.06.03 (90d5) For  WWN. root@server:/root# for host in `ls /sys/class/scsi_host/`; do cat /sys/class/scsi_host/${host}/device/fc_host\:${host}/port_name 2>/dev/null; done 0x2100001b32898bbd 0x2100001b3289b3bf To rescan looking for new disks # for host in `ls /sys/class/scsi_host/`;do echo "- - -" Read more...
Sometimes we would like to access devices with a more friendly naming or unify naming with disks or devices. Normally USB disks naming depends the order you connect the disk, so if you want to set always the same name for a specific device to access it as /dev/ipod follow next rules to symlink to a new name. To link devices in /dev find the block device, for example with sdi USB disk. # udevinfo -q all -n /dev/sdi P: /block/sdi N: sdj and check which parameters we can use, here is the output Read more...
Special characters to show useful information in $PS1 prompt: \h short hostname (without domain). \H long hostname. \n new line. \s shell name (like bash, sh) \t 24h format clock. \u current username. \v shell version. \w current folder. Inside PS1 we can add the output of a specific command, preferably with short output, like  PS1=$(date) We can color the prompt messages just adding  \[\033[COLORm\]. and \[\033[0m\] to stop colors to avoid colored commands. Where COLOR Read more...