Let's suppose you want to replace the disk in a system that uses LVM and has a separate /boot partition.
In this case we also presume that /boot is identified in fstab via a label.
/boot partition to the new diskboot:e2label /dev/sdb1 /boot
pvcreate /dev/sdb2 vgextend VolGroup00 /dev/sdb2
pvmove /dev/sda2 vgreduce VolGroup00 /dev/sda2
root (hd1,0) setup (hd1) quit
for bus in /sys/class/scsi_host/host*/scan ; do echo "- - -" > $bus done
chkconfig --add scriptname chkconfig scriptname on service scriptname start
chkconfig --del scriptname
rpm -ivh mypkg.rpm # install rpm -Uvh mypkg.rpm # Update rpm -qa # list installed packages rpm -qi mypkg # package info rpm -ql mypkg # package contents
setup
Launch the graphical tool with:
system-config-network
rhn_register
service yum-updatesd stop chkconfig yum-updatesd off
To open an Apple Mac OS X Disk Image (.dmg) in linux you can try:
.img as directed by the dmg2img output
I never managed to make it work BTW
A nice explanation picture borrowed from http://billauer.co.il/ipmasq-html.html
echo 1 > /proc/sys/net/ipv4/ip_forward
With masquerade you don't need to know the address of the external interface (good for dynamic IP). Furthermore, when the connection goes down the connection/translation table gets cleared
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
With Source NAT you have to specify the IP of the outgoing interface, and the slate table are retained:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 1.2.3.4
When using – for example – NAT and wanting to allow only outgoing connections:
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT iptables -P INPUT DROP iptables -A FORWARD -i eth1 -o eth1 -j REJECT