Showing posts with label VMware Workstation. Show all posts
Showing posts with label VMware Workstation. Show all posts

Monday, February 20, 2012

Cloned Red Hat/CentOS/Scientific Linux Virtual Machines and “Device eth0 does not seem to be present” Message

— SkyHi @ Monday, February 20, 2012
Recently I was preparing some new virtual machines in VMware running Scientific Linux 6.  I encountered some difficulty with the virtual network interface after preparing clones of the machines.  In particular I was unable to get the virtual NIC on the newly cloned machine to be recognized as a valid interface.  Upon further investigation the NIC on the newly cloned machines was being registered as “eth1″.  We can check the currently registered “eth” devices here:

[root@sl6 ~]# ls /sys/class/net
eth1  lo  sit0

As it turns out there is a device manager for the Linux kernel named “udev” which remembers the settings from the NIC of the virtual machine before it was cloned.  I was not familiar with udev because it was not installed in my previous Linux VM install, which were mainly CentOS 5.
Since the hardware address of the network interface changes as part of the clone, the system sees the NIC after the clone as “new” and assigns it to eth1.  The simple way to move the interface back to eth0 is to edit the strings beginning with “SUBSYSTEM” in udev’s network persistence file.
Start off by removing the first “SUBSYSTEM” entry that represents the “old” eth0 interface.  Then edit the second “SUBSYSTEM” entry, changing the “NAME” parameter from “eth1″ to “eth0″.  Of course your config may vary from mine.  Keep in mind that the “SUBSYSTEM” line may be wrapped in the text below.
Old file:

[root@sl6 ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x15ad:0x07b0 (vmxnet3) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:87:00:21", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:87:00:25", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

New file:

[root@sl6 ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x15ad:0x07b0 (vmxnet3) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:87:00:25", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Now verify that you have a properly configured network config file, the example below is for Red Hat/CentOS/Scientific Linux:

[root@sl6 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:50:56:87:00:25"
IPV6INIT="no"
IPV6_AUTOCONF="no"
NM_CONTROLLED="no"
ONBOOT="yes"
IPADDR="192.168.10.125"
NETMASK="255.255.255.0"
NETWORK="192.168.10.0"
BROADCAST="192.168.10.255"
Now reboot the system and the NIC should now be registered as eth0!






REFERENCES
http://aaronwalrath.wordpress.com/2011/02/26/cloned-red-hatcentosscientific-linux-virtual-machines-and-device-eth0-does-not-seem-to-be-present-message/

Monday, November 14, 2011

no network after copying ubuntu vmware

— SkyHi @ Monday, November 14, 2011
After you copy an Ubuntu image, you'll probably lose your network connectivity. After a little bit of digging, it turns out that Ubuntu persists the MAC address of the network device in /etc/udev/rules.d/*net.rules . The fix:
sudo rm /etc/udev/rules.d/*net.rules
  sudo shutdown -r now #to reboot 
 
REFERENCES
http://muness.blogspot.com/2009/01/no-network-after-copying-ubuntu-vmware.html

Tuesday, February 2, 2010

dev volgroup00 logvol00 unexpected inconsistency

— SkyHi @ Tuesday, February 02, 2010
So today I ran Synaptic to get the current batch of updates. One of the updates was a new Kernel for Fedora systems, yay. I reboot so I can use the new kernel (and possibly uninstall the old one) but an error occurs.

As the machine is starting up it does it's usual detecting hardware and setting hostname. After that, it goes to check the root filesystem and bombs with this error:

Checking root filesystem
/dev/VolGroup00/LogVol00: UNEXPECTED INCONSISTENCY; RUN
fsck MANUALLY.

*** An error occured during the filesystem check.
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
*** {Some stuff about disabling SELinux here}

So I log into the shell as root and run fsck with the option to check for bad blocks and answer yes to all questions about relocating sectors. It goes through and claims to fix some orphaned sectors and nodes, relocates some sectors that seem to have to references (or something along those lines) and some other things which I did not catch completely. It seems to loop and start itsself again, so after the second time it did this I interrupted it and rebooted. Alas, I have the same error and do not know how to fix this. Please help me.

Thank you in advance.


Solution:

I'm having the same issues. I tried adding a second hard disk to my volume group. I ran the following commands

fdisk /dev/hdb
n (new)
p (primary)
1 (first partition)
t (type)
8e (lvm)
w (write to disk)

pvcreate /dev/hdb1

vgextend VolGroup00 /dev/hdb1

lvextend /dev/VolGroup00/LogVol00 /dev/hdb1

#rebooted with rescue cdrom

lvm vgchange -a y Volume00

lvm lvchange -a y /dev/VolGroup00/LogVol00

e2fsck -y -f /dev/VolGroup00/LogVol00 (competed without errors)

resize2fs -f /dev/VolGroup00/LogVol00 (added the -f because it was complaing that I should run e2fsck -f and I had already done that)

e2fsck -f /dev/VolGroup00/LogVol00

This is where I started getting the errors described above. I can access my files from the rescue disk, but I can not boot because of LVM inconsistancy errors.

REFERENCE
http://forums.fedoraforum.org/archive/index.php/t-51550.html




Step by step solution:
==========================================
Your system appears to shut down uncleanly

Checking file system

/dev/VolGroup00/LogVol00: Reside inode is not valid

/dev/VolGroup00/LogVol00: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

(i.e., without -a or -p options)


*** Run 'setenforce 1' to reenable.
Give root password for maintenance
(or type Control-D to continue): Type root password


(Repair filesystem) df
File System 1K -block Use Available Use% Mount
/dev/VolGroup00/LogVol00
37864976 13675768 22265728 39% /
/dev/hda1 37864976 13675768 22265728 39% /boot

#(Repair filesystem) fsck -f -y /dev/VolGroup00/LogVol00

Resize inode not valid. Recreate? (yes)

/dev/VolGroup00 contain a file sytem with errors, check forced.

Pass 1: Checking inodes, blocks, and sizes
Duplicate blocks found... invoking duplicate block passed
Pass 1B: Rescan for duplicate/bad blocks
....

File /usr/src/linux-2.6.9/arch/s390/appldata/Makefile
Duplicateed blocks already reassigned or cloned

Pass 2: checking directory structure
Pass 3: checking directory connectivity
Pass 4: checking reference counts
Pass 5: checking group summary information
Free blocks count wrong for group #0 (19039,counted = 19040)
Fix? Yes

/dev/VolGroup00/LogVol00: ***** FILE SYSTEM WAS MODIFIED *****
/dev/VolGroup00/LogVol00: ***** REBOOT LINUX *****
/dev/VolGroup00/LogVol00 428503/4816896 files (2.3 % non-contiguous), 3570106/9617408

(Repair filesystem) fsck /dev/hda1
/boot clean, 39/26104 files 12402/104308 blocks


#(Repair filesystem) reboot


REFERENCE
http://www.linuxforums.org/forum/redhat-fedora-linux-help/134007-can-not-boot-my-linux-machine.html





Why my Linux server ext3 filesystem go read-only?

— SkyHi @ Tuesday, February 02, 2010

From my mailbag:

We have 5 Dell server collocated running CentOS 4.x and 5.x server operating system. Sometime my file system (ext3) goes read-only. I’d like to know what could be causing such a problem?

My guess:
a) Hardware problem / hard disk problem, check harddisk for errors.

b) High disk I/O aka busy I/O retry error can mark low level disk call as failed. This will force ext3 to go into read only mode.

c) High disk I/O on SAN

d) SAN is not configured properly for the path failover.

In all sort of problems ext3 goes read-only to protect the filesystem and further damage. If you are using VMWARE, check out official webpage to download SCSI patches or workaround for vmware problems.

So what could be causing the file system on Linux go read-only?

Apart from above generic problem, any other error can trigger filesystem on Linux go read only. I hope our reader / seasoned Linux admin can help to answer this question. Please share the experiences and advice in the comments.


REFERENCE

http://www.cyberciti.biz/tips/linux-filesytem-goes-read-only.html

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=51306