Tuesday, March 20, 2007

Linux Quota Support

http://www.yolinux.com/TUTORIALS/LinuxTutorialQuotas.html

mdadm software raid usage

Install
mdadm package needed (aptitude install mdadm)

http://neil.brown.name/blog/mdadm


Create array:

mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1
or
mdadm -Cv /dev/md0 -l0 -n2 -c128 /dev/sdb1 /dev/sdc1

/etc/mdadm.conf

# optional, but used for easier interaction
DEVICE /dev/sdb1 /dev/sdc1
ARRAY /dev/md0 devices=/dev/sda1,/dev/sdb1

Show md info:
# produces output that you would put in the mdadm.conf

mdadm --detail --scan

Show device info:
mdadm -E /dev/sdc1
# shows info about the component disks

Start (assemble) Existing Array:
mdadm -As /dev/md0
# -A starts assemble mode to assemble existing array
# -s indicates the use of /etc/mdadm.conf
or
mdadm -A /dev/md0 /dev/sdb1 /dev/sdc1
# starts array without existing /etc/mdadm.conf

Assemble an existing array automatically:
mdadm --assemble --scan
or
mdadm -As

Stop the array:
mdadm -S /dev/md0
or
mdadm --stop /dev/md0

Add a disk:
mdadm /dev/md0 --add /dev/sdc1

Remove a disk:
mdadm /dev/md0 --fail /dev/sdc1 --remove /dev/sdc1
# "fails" and removes a disk

fstab entry for the array:
# this assumes the array was formated with ext3
/dev/md0 /export/ ext3 suid,dev,defaults,exec 0 0


http://www.linuxdevcenter.com/pub/a/linux/2002/12/05/RAID.html

Saturday, March 03, 2007

SUDO

Generic syntax of /etc/sudoers
<users_to_allow> <host> = (run_as_user) <command_to_run>
<users_to_allow> <host> = (run_as_user) <file_to_grant>

No password for users in admin group

%admin ALL= (ALL) NOPASSWD: ALL

No password for joeuser user
joeuser ALL=(ALL) NOPASSWD: ALL

Allow joeuser to run only certain privileged commands as root
joeuser ALL= /bin/kill, /usr/local/bin/

Allow joeuser to run certain commands as given users
joeuser ALL=(janeuser,johnuser) /bin/kill, /usr/local/bin

Run sudo command as another user using
sudo -u janeuser /bin/kill

http://aplawrence.com/Basics/sudo.html