Ubuntu boots into initramfs
Don’t panic, your boot sector is still good an readable. Type ‘exit’ and you’ll complete the boot process. But why does this happen and how can we fix it? From my reading this can be caused by faults on the disk or an improperly formatted grub configuration or hardware controllers that are too slow responding with the information needed by the grub to complete a clean boot.
DISK FAULTS
If you have a bad sector or two you can address this with the commands below. Or, you may need to boot into the live CD and fsck -y
sudo touch /forcefsck
sudo shutdown -r now
SLOW CONTROLLER HARDWARE RESPONSE
If the controller hardware takes too long to respond back with the correct devices the system will advance without properly identifying them. In Ubuntu you can address this in the /etc/default/grub file by changing the GRUB_CMDLINE_LINUX line as follow:
GRUB_CMDLINE_LINUX=”rootdelay=60″
update-grub
reboot
IMPROPERLY FORMATTED GRUB
Not sure the best way to go about this, but what I read was related to a mismatch in the selected boot partitions in /etc/fstab and those in the grub. I have definately seen SuperMicro system where the drives flipped about on boot. This is caused by a RAID configuration that works well with Windows installs but confounds Linux. It’s controlled at BIOS/CMOS level and can be removed with dmraid. Yeck! Drop me a note if you need help with this. I likely have the recipe for fixing it.
KERNEL PANIC – Missing Init
Init is process id #1, the #1 that all other processes are started from. The first one run after boot and the one that cleans up when you are shutting down. This isn’t a kernel panic at all, but a failure on the init process. FSCK it.
Ubuntu Live CD, opened the terminal and typed:
sudo debugfs -w /dev/sda1 debugfs 1.41.11 (14-Mar-2010) debugfs:
type in: clri <8>
and after hitting enter,
type this: quit
then reboot. It should force an fsck and come up happy.
Installing Oracle with an RPM
Recently I took on the task of finding a way to install oracle 11gR2 on CentOS x64. This process seems to not be talked about on the Internet, or maybe I just don’t know how to search.
So, what makes it so difficult? It’s larger than the maximum allowed RPM size of 2GB, but that shouldn’t stop you from breaking it up into two RPMS where the second one calls the installer in silent mode.
I have it working, but I just wondered why the Internet is so silent about this subject.
ANSWER:
A couple of weeks later and it looks like a matter of too much oracle documentation. Oracle owns the SEO on these terms and penetrating them isn’t going to a simple matter of setting up an teaser article with a few terms filled out. I’m going to try a few keywords and see how that goes for me.
keywords: rpmbuild
Adding a Host to an HA VMWare Cluster
When adding a new piece of iron to a high-availability (HA) cluster your CPU compatibility matters. HA means vMotion is involved and vMotion is able to bridge the various pieces of hardware using “Enhanced vMotion Compatibility” or EVC for short. EVC is a mode you set that allows the servers to function at their highest common denominator, or rather, the greatest level of shared compatibility. So, if you have a new system with all kinds of additional CPU capabilities but your old system is still L4 “Sandy Bridge” then your system must be setup to use L4.
- L0 – Intel “Meron” Xeon Core 2
- L1 – Intel “Penryn” Xeon 45nm Core 2
- L2 – Intel “Nehalem” Xeon Core i7
- L3 – Intel “Westmere” Xeon 32 nm Core i7
- L4 – Intel “Sandy Bridge”
- L5 – Intel “Ivy Bridge”
So… just use VMWare’s Compatibility Guide? No, you need to apply some common sense as well. I just went shopping for an r720 to work with our ‘Sandy-Bridge” hexcore r710′s and found that the compatibility guides doesn’t really cover new systems very well. Take a look at Wikipedia and look up your processor. In my case, I have a choice of quite a few Xeon E5-26xx processors, but there is a note that the Xeon E5-2603 and Xeon E5-2609 do not have Hyper-threading capabilities. Well, my other systems certainly do. Also, these are quadcore rather than hexcore. So, problem avoided. I need to spend a couple hundred more on a proper processor so I don’t have to degrade my EVC Mode.
Reference:
- http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003212
- http://www.vmware.com/resources/compatibility/search.php
- http://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors
About Jay Farschman - Jay currently works as a Senior Systems Administrator for an asset management company in Colorado where he works with companies that produce hardware, telecommunications software and financial services. Jay previously owned a consulting company and provided training and consulting services for three Fortune 500 companies and numerous small businesses where he leveraged Linux to provided exceptional value.
Protected: KOHA Reports
PostgreSQL Replication to a Warm-Standby Using WAL Files
THEORY
Like a good relational database, PostgreSQL maintains a set of transactional log file known as write-ahead-logs (WAL) in the pg_xlog directory. These logs are written to for every change in the database files and are used to recovery from a crash condition. If you crash, replay all the WAL files since the last backup and you will be back in business right at the point of failure.
Well, if you have this capability, what about keeping a warm-standby system and feeding it all the WAL files. If you teach it how to continuously process the incoming write ahead logs from the live system you will have a system ready to go at a moments notice. When you read about this setup in other places on line the primary server is known as ‘master’ and the secondary the ‘slave’.
NOTE BENE: Both your primary and your secondary need to be running the same major version of the postgreSQL database. Continue reading
Restoring Files From RackSpace Cloud Files
If you are like me and have a cloud server on rackspace you probably have a backup of your server that runs weekly or daily but may have never found a nice way to access these files. In fact, i was on chat with a Fanatical Support guy the other day shortly after I had deleted my httpd.conf file. I asked him if I could restore a file using my cloud file backups and he said “No”.
That bothered me, but I don’t expect support the guys to be all knowing, even if it is a top-notch organization like Rackspace. The real answer is yes. Here is how it’s done.
If you are familiar with the API calls for interacting with RackSpace programmatically, you should probably skip this article, it’s going to be really basic. If you want to learn these calls, then I found a nice article here that describes pulling and extracting the files for a Windows image and getting a .vhd file
ANATOMY OF A BACKUP
So logging in to the RackSpace Cloud interface and you should see a new(ish) addition to the Hosting Menu. Choose “Cloud Servers” under the Open Cloud and then you’ll enter a new interface. Once there click on “Files” At this point you see your files. Yes, you can see them in the old interface, but you cannot download them.
What I found was a set of files with a timestamp in them and a site ID. One meta file that ends and .yml and describes all of the other compressed tarballs that contain the actual data. You probably noticed that the tarballs are incremented (0, 1, 2, etc)
--- name: daily_20120827_111111_cloudserver1111111.yml
format: tarball image_type: full files: - daily_20120827_111111_cloudserver111111.tar.gz.0 - daily_20120827_111111_cloudserver111111.tar.gz.1 - daily_20120827_111111_cloudserver111111.tar.gz.2
WHAT TO DO WITH THEM
If you have all the files in one directory you should be able to address them line this. Remember, I’m trying to find my httpd.conf. Well, this is going to find any and all httpd.conf file in the tar.gz files available.
for tarball in `ls -1 *cloudserver111111.tar.gz.*`
do
recoveryfile=`tar -tzf $tarball | grep httpd.conf`
tar -zxvf $tarball $recoveryfile
done
You will want to change the file you are looking for (httpd.conf) and the first line which defines the files you want to look through. I’d use the find * command at the end to expose the directory structure that was created.
Hard Drive Related Cheatsheet for Linux
TERMINOLOGY:
- Partition - a portion of physical hard disk space. A hard disk may contain one or more partitions. Partitions are defined by BIOS and described by partition tables stored on a harddrive.
- Volume - a logical concept which hides the physical organization of storage space. A compatibility volume directly corresponds to a partition while LVM volume may span more than one partition on one or more physical disks. A volume is seen by users as a single drive letter.
- Physical Volume (PV) Synonym for “hard disk”. A single physical hard drive.
- Volume Group (VG) A set of one or more PVs which form a single storage pool. You can define multiple VGs on each system.
- Logical Volume (LV) A usable unit of disk space within VG. LVs are used analogously to partitions on PCs or slices under Solaris: they usually contain filesystems or paging spaces (“swap”)Unlike physical partition can span multiple physical volumes that constitute VG. .
- Root partition. Physical or logical partition what holds root filesystem and mount points for all other partitions. Can be physical partition or logical volume.
LVM Commands
- pvcreate /dev/hda3 – creates physical volumes
- vgcreate vg01 /dev/hda3 – creates a volume group (in this case, vg01) using the physical volume
- lvcreate -l25000 -nlv01 vg01 – creates a logical volume using the volume group, allocating 25000 blocks
- lvcreate -L4G -nlvroot vgraid1
- vgextend – adds a volume to the volume group (if you add a new disk)
- lvdisplay -v /dev/vg01/lv01
- vgdisplay -v vg01
- lvremove
- vgreduce
- mkfs -t ext3 /dev/vg01/lv02 makes a file system
- mount /dev/vg01/lv02 /home/new mount the file system
- mount -a mounts everything in /etc/fstab
- vgscan –mknodes
- vgchange -a y /dev/vgraid1 (bring /dev/vgraid1 online if it didn’t come up automatically)
- lvscan
- mkfs -t ext4 -t small /dev/vgraid5extra
- umount /home/new (unmount a filesystem)
- pvresize – update size of pv
- lvextend -L+ /dev/vgraid0/lvsharedfiles0
- e2fsck -f /dev/vgraid1/lvsharedfilestemp (check filesystem)
- resize2fs /dev/vgraid1/lvsharedfilestemp (resize the filesystem) (now works online)
MDADM stuff
RAID
raidtools2
mdadm (probably a better choice)
/etc/raid/raidtab
http://unthought.net/Software-RAID.HOWTO/
http://xtronics.com/reference
http://juerd.nl/site.plp/debianraid
mdadm -Cv /dev/md0 -l1 -n2 missing /dev/sda1 –auto creates a degraded raid 1 array
mdadm -Cv -c 256 /dev/md20 -l5 -n2 missing /dev/sdf1 array with chunk size
mdadm -A -a /dev/md0 /dev/sda1
mdadm -A -a /dev/md1 /dev/sda2
fixing a degraded array
mdadm –add /dev/md7 /dev/sdd2
mkfs -t ext3 /dev/md20 – make a file system
mkfs -t ext3 -T largefile4 -E stride=16,stripe-width=2 /dev/md20 – reduce inodes, runs faster on big files
largefile4 is defined in /etc/mke2fs.conf, blocksize defaults to 4096, so with chunk size of 256, we need stride of 16
mdadm –detail –scan >> /etc/mdadm/mdadm.conf
Critical Warning Number 6 – (Fake or Scam)
Every now and then I hear a commercial on the radio that piques my interest. In this case it’s the radio add “Critical Warning 6″ which I end up listening to every morning on the way to work in July and August 2012. In part, it goes:
Something very big will happen in America within the next 180 days. It will be more devastating than the credit crisis of 2008. For most people, it will hit them like a brick wall. It will touch Americans harder and deeper than anything else we've seen since the Great Depression. Michael Lombardi feels so strongly about this, he's decided to present his "Critical Warning Number Six" in a new video. In case you're not familiar with him... Michael Lombardi has been widely recognized as predicting five major economic events over the past 10 years. In 2002, he started advising his readers to buy gold– related investments when gold traded under $300 an ounce. In 2006, he begged his readers to get out of the housing market...before it plunged.
My thoughts, and please share your own on this issue below:
- Scare Tactic – The voice used for the advertising is a threatening male voice about to tell you something you don’t want to hear.
- Timing – “Within the next 180-days… “ As of this writing if you poke around on like you can find mention of this ‘prediction’ going back to November of 2011 and possibly further back.
- Verification of Past Predictions – I tried to use the Internet Archive Wayback Machine to see what this website looked like in the past. After all, if Mr. Lombardi has posted his past predictions online we should be able to see them. Unfortunately, the Wayback Machine doesn’t seem to have an old web archives of his content.
- Who Else Made These Predictions? – I read a book prior to the present economic crisis by Harry S. Dent that seems to say the same thing Michael Lombardi is saying, but the information is verifiable. A few differences. The Wayback machine shows Dent ready to publish his book back in July of 2008. Dent sells a newsletter that essentially draws parallels to the great depression 80-some-years ago. It’s a good read and I’m a firm believer that history is a fine indicator of the future. But as the immortal Samuel Clemen once said, “History does not repeat itself, but it does rhyme”
- Why Share Your Knowledge? – If you lived in the future, let’s say the year 2022 and you traveled back to 2012 what would you do with your knowledge? How would you leverage this knowledge? One way would be to setup a newsletter and charge $200/year sharing your knowledge with others. The other would be to take your capital and make smart investments. Then there is the third way; you could invest with your knowledge of the past and then share the knowledge as a newsletter. If you invest first and have a large enough following you can make money as your followers invest and drive up prices.
I’ll probably come back to this and add as time allows.
About Jay Farschman - Jay currently works as a Senior Systems Administrator for an asset management company in Colorado where he works with companies that produce hardware, telecommunications software and financial services. Jay previously owned a consulting company and provided training and consulting services for three Fortune 500 companies and numerous small businesses where he leveraged Linux to provided exceptional value.
Viewing Your Linux Hardware with DMIDECODE
I never like opening a running system when I can simply query that system with a simply command for the information needed. dmidecode is a great tool for polling hardware information in human-readable format.
In its simplest form you will dump all the information to the screen
dmidecode
but that’s a bit much so try running with the -t argument which lets you narrow down the search to the components (bios, system, baseboard, chassis, processor, memory, cache, connector, slot) So, for instance, if need to learn how much RAM you system can handle:
# dmidecode -t memory # dmidecode 2.10 SMBIOS 2.7 present. # SMBIOS implementations newer than version 2.6 are not # fully supported by this version of dmidecode. Handle 0x0027, DMI type 16, 23 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Single-bit ECC Maximum Capacity: 32 GB Error Information Handle: No Error Number Of Devices: 4
Enjoy and let me know you you end up using this command.