Useful shell/kernel commands

Some useful commands you can issue from shell, to change some kernel/system parameters. Guess there gonna be more later, but now some I use very often.

echo "scheduler_name" > /sys/block/"device_name"/queue/scheduler
changes ioscheduler for block device "device_name" (e.g. sda, xvda, hda), to "scheduler_name", where "scheduler_name" could be: noop, anticipatory, deadline or cfq.

To rescan SCSI device use:
echo "1" > /sys/bus/scsi/drivers/sd/"device_address"/rescan where "device_address" is something like 0:2:0:0.

To rescan whole SCSI host use:
echo "- - -" > /sys/class/scsi_host/"scsi_host_name"/scan, where "scsi_host_name" is something like host0.

3 above commands are very usefull if you don't want to reboot your system everytime you change something in your block devices configuration (e.g. SAN lun size, added new lun, wanna change scheduler for database block device).

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Main menu

Article | by Dr. Radut