6
Apr/09
0

VMware – Linux: OS cannot mount /dev/sd* after a virtual machine is converted – Waiting for device /dev/sd* to appear… not found – fall back

This happened when I created a SLES 11 VM with VMware Workstation and then moved to to ESX for production. Problem was that VMware Workstation used LSILogic SCSI drives to emulate my disks, but for some reason it wasn’t made clear to ESX by VMware Converter during conversion.

To fix this browse to your datastore and download your guest’s configuration file <vmname>.vmx to your desktop (or use your root access and open it in vi through ssh). Open it with a text editor and add the following line above your SCSI devices:

scsi0.virtualDev = "lsilogic"

So the whole SCSI device section should look like this:

scsi0.present = "true"
scsi0.sharedBus = "none"
scsi0.virtualDev = "lsilogic"
scsi0:0.present = "true"
scsi0:0.fileName = "disk1.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:1.present = "true"
scsi0:1.fileName = "disk2.vmdk"
scsi0:1.deviceType = "scsi-hardDisk"

Copy the config back to your datastore and start guest OS. You will be asked to confirm changes during post – answer yes to changes.

Disclaimer: Make sure you have a backup before making any change.

13
Mar/09
0

Linux: How to ifdown in a remote server

6 million dollar question… want to ifdown/ifup but don’t have physical access to your server? you can ifdown and ifup in one command:

ifdown eth0 && ifup eth0

That’s how you combine more than one command in one line!

Tagged as:
2
Jan/09
0

Linux: User management

useradd: Add new users commands:
-d specify home directory
-s shell
-p specify password
-g user’s primary group
-G user’s other group
-m create home directory

The following command creates a user “ali”, adds to groups users and admin and create his home directory:

useradd -g users -G admin -p <password> -d /home/ali -m ali -s /bin/shell

usermod: Modify existing users
Use above switches to modify a user

Add “ali” to another group:

usermod -G <groupname> ali

userdel: Delete a user
Removes the user “ali”. To delete home directories use -r switch:

userdel -r ali

passwd: user Password
Logged on users can just use passwd to change their password. If root is changing a user’s password:

passwd <username>

su: switch user
To switch from current user to another:

su <username>

You may switch from root to another user without entering user’s password, but not the other way around. This will not log off current user. To return to previous user shell type “exit”.

Users, passwords and group information are stored in these files:

Users: /etc/passwd
Groups: /etc/group
Passwords: /etc/shadow

Tagged as:
30
Oct/08
0

mySQL: How to backup/restore SQL databases through SSH

To backup your database through SSH (create SQL dump):

mysqldump --opt -u user -p dbname > {path}/backup.sql

To restore:

mysql -u user -p dbname < {path}/backup.sql
Tagged as: , ,
29
Oct/08
12

Debian: Symantec Backup Exec 12 and Debian Etch 32/64

To install Symantec Backup Exec 12 agent under Debian Linux (32 and 64 bit). Version numbers have been masked with “xxx” to make it a general post.

Find the appropriate agent from the installer CD or download the latest version from Symantec website. 32 bit packages are normally under /Linux/RALUSx86/pkgs/Linux and 64 bit under /Linux/RALUS64/pkgs/Linux. Both packages must be properly installed: VRTSralus and VRTSvxmsa.

To untar:

tar -zxvf VRTSralus.tar.gz
tar -zxvf VRTSvxmsa.tar.gz

Symantec provides rpm packages so we will have to convert them to deb. If you don’t have the package “alien” installed use the command aptitude install alien to install the package.

Converting rpm to deb:

alien --scripts VRTSralus-xxx.rpm
alien --scripts VRTSvxmsa-xxx.rpm

(64 bit packages end with x86-64.rpm).

Installing deb packages:

dpkg -i vrtsralus-xxx-.deb
dpkg -i vrtsvxmsa-xxx-.deb

RALUS runs under a backup user called beoper. Go ahead and add the user/group and give it root access:

addgroup beoper
adduser root beoper

Before loading the agent for the first time install the following packages:

aptitude install libstdc++5

for 64 bit Debian you will need an additional package:

aptitude install ia32-libs

Now load the agent for the first time to have it create your configuration file. Backup Exec installation will copy your init script to /opt/VRTSralus/bin/VRTSralus.init. Either run it directly from there or create a symbolic link where your other scripts are:

ln -s opt/VRTSralus/bin/VRTSralus.init /etc/init.d

Load the agent:

/etc/init.d/VRTSralus.init start

OK confirms that your script ran properly, and if you followed my direction it should. Now kill the process

/etc/init.d/VRTSralus.init stop

and go open the configuration file

nano /etc/VRTSralus/ralus.cfg

Insert the following string and replace the IP to match your media server’s:

Software\Symantec\Backup Exec For Windows\Backup Exec\Engine\Agents\Agent Directory List_1=192.168.1.35

I have highlighted what I think is important: agent advertising option and your media server IP. Make sure they are correct and if you don’t have any of those lines go ahead and add them to your config file.

Save/close the file and re-run your agent. You’re all set! If you like to have the agent run every time your box reboots navigate to /etc/init.d/ and:

update-rc.d -f VRTSralus.init defaults

Note that Backup Exec 12.5 comes with a pre-compiled .deb package. Hooray for Symantec!