Thursday, April 7, 2011

Rescue Linux using Live CD via chroot

There are times when you mess up something on the system and you need to rescue it using safe boot etc.  However, this can be a real daunting task if you need a fast cure to most common problems.  Like for example if you have stuff where you need to remount and extend partitions etc.

Solution:  Boot using Live-CD!

1. Boot to your Live-CD environment
2. Create a virtual directory to mount the partition
3. Issue the command:  #mount -t fs.type -o "options" /path/partion /path/directory
4. Issue the command #chroot /path/directory

This drops you to the working directory of your current system and fix things.  Note, that you may have to mount all partitions to the same directory to get all the libraries needed to run the system correctly.

Wednesday, April 6, 2011

Create files with a leading dash "-" in Linux/Unix

If you happen to need a file created with a leading dash "-" all you have to do is add the double "--" and the "-"  

Example:  touch -- -thisfile  

The concept is pretty much the same as on how you would delete,move,edit files with a leading dash.

Example:  rm -- -thisfile
                 mv -- -thisfile
                 vi -- -thisfile

This is handy if for example you have sites that needs id verification from site rating providers etc. 

It's one of those days when you really need to get things done immediately but you have to browse the Internet for some answers.  Cheers!