Traditionally I use commands like "ls -lh" to give me size of files inside a directory but if you try and read the size of a directory with this it will not give you the correct sizing.
There is all sorts of ways of getting the directory but I now use "du -sh" directory_name to show me the correct size. Writing this into my bash scripts now and will post when I am done to give you a hand way of finding out your disk usage.
example output:
du -s Music/
1096972 Music/
du -sh Music/
1.1G Music/
Monday, April 8, 2013
Thursday, November 29, 2012
Bring ESX host out of maintenance mode without vCenter
I had a downtime recently that we were moving very old hardware running VMware ESX 3.5. After the move the vCenter server would not start up, it wouldn't even boot! The worst part is the hosts were in maintenance mode and wouldn't manually allow me to start the guests from the command line!
The command to exit maintenance mode also failed:
vimsh -n -e /hostsvc/maintenance_mode_exit
So I knew this being based off of linux that there had to be a conf. file of some sort somewhere that told the host that it was in maintenance mode or not. I found it here:
/etc/vmware/hostd/hostsvc.xml
This is what the code should look like:
mode normal mode
B y editing the file and changing the word maintenance to normal and rebooting the host I was then able to issue the command to start the vm:
vmware-cmd vm_guest.vmx start
It worked!
The command to exit maintenance mode also failed:
vimsh -n -e /hostsvc/maintenance_mode_exit
So I knew this being based off of linux that there had to be a conf. file of some sort somewhere that told the host that it was in maintenance mode or not. I found it here:
/etc/vmware/hostd/hostsvc.xml
This is what the code should look like:
mode normal mode
B
vmware-cmd vm_guest.vmx start
It worked!
Error message when you try to set an IP address on a network adapter
Recently I have done some P2V and V2V migrations with the guests being windows 2003 and above and I get an error message when I go to IP the new nic's about there being a "hidden" nic with the same IP address. I followed this KB and it did work. In short here are the steps that I did:
Method 1
- Click Start, click Run, type cmd.exe, and then press ENTER.
- Type set devmgr_show_nonpresent_devices=1, and then press ENTER.
- Type Start DEVMGMT.MSC, and then press ENTER.
- Click View, and then click Show Hidden Devices.
- Expand the Network Adapters tree.
- Right-click the dimmed network adapter, and then click Uninstall.
Monday, October 15, 2012
create a .img file (floppy disk image)
I needed to mount a floppy disk image in a guest virtual machine onVMware ESXi. It's been so long since I have needed one of those I had to use my googlefu.
I ran across a blog post from untitledfinale that did the trick. Here is the code that I used:
dd bs=512 count=2880 if=/dev/zero of=imagefile.img
mkfs.msdos imagefile.img
sudo mkdir /media/floppy1/
sudo mount -o loop imagefile.img /media/floppy1/
Worked like a charm, but there was one problem. vSphere4 wants to mount a .flp not a .img for a floppy image. No worries just rename it to .flp and your good to go!
I ran across a blog post from untitledfinale that did the trick. Here is the code that I used:
dd bs=512 count=2880 if=/dev/zero of=imagefile.img
mkfs.msdos imagefile.img
sudo mkdir /media/floppy1/
sudo mount -o loop imagefile.img /media/floppy1/
Worked like a charm, but there was one problem. vSphere4 wants to mount a .flp not a .img for a floppy image. No worries just rename it to .flp and your good to go!
Tuesday, June 26, 2012
Get Evolution to work with Exchange 2010
I have been dying to have a fully functional email client for my linux machine that would work with our corporate Exchange 2010 environment. Looks like its now possible with the evolution-mapi plugin. I found these instructions and they worked flawlessly on my Mint 12 box!
One less thing to rely on a windows machine!!!
One less thing to rely on a windows machine!!!
Tuesday, June 5, 2012
Execute when any user logs in without Group Policies
Sometimes you just need to have something run for all users that log into a certain box but you don't want a GPO for it. Local group policies don't work either if they log in with AD credentials. It used to be that you could just put the .exe or .bat/.vbs into the startup directory. You still can but its a little harder with w2k8/w7.
The easiest way is to click start, all programs, then right click on startup and choose explore all users. Then just drop a link or the file into that directory and you should be right as rain. Here is the long UNC for it:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
The easiest way is to click start, all programs, then right click on startup and choose explore all users. Then just drop a link or the file into that directory and you should be right as rain. Here is the long UNC for it:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
Putting a file on all users desktop in Win 7/Server 2008
Just put the file in c:\users\Public\Public Desktop and everyone on that box will get it on their desktop. Only users with Admin level privileges can delete it!
Subscribe to:
Posts (Atom)