Posts

Showing posts from January, 2015

How to mount LVM partitions from rescue mode (Fedora/CentOS/RedHat)

How to mount LVM partitions from rescue mode (Fedora/CentOS/RedHat) Boot your rescue media. Scan for volume groups: # lvm vgscan -v Activate all volume groups: # lvm vgchange -a y List logical volumes: # lvm lvs –all With this information, and the volumes activated, you should be able to mount the volumes: # mount /dev/ volumegroup / logicalvolume / mountpoint found at: http://jim-zimmerman.com/?p=587

How can I get my external IP address in bash?

 How can I get my external IP address in bash? I'd recommend getting it directly from a DNS server. Most of the answers here all go over HTTP to a remote server. Some of them require parsing of the output, or rely on the User-Agent header to make the server respond in plain text. They also change quite frequently (go down, change their name, put up ads, might change output format etc.). The DNS response protocol is standardised (the format will stay compatible). Historically DNS services ( OpenDNS , Google Public DNS , ..) tend survive much longer and are more stable, scalable and generally looked after than whatever new hip whatismyip.com HTTP service is hot today. (for those geeks that care about micro-optimisation), this method should be inherently faster (be it only by a few micro seconds). Using dig with OpenDNS as resolver: dig + short myip . opendns . com @resolver1 . opendns . com   Perhaps alias it in your bashrc so it's easy to remembe