Tech Tips with Gnull and Voyd
Hey there sweeties, I'm Laverta Voyd, and my husband Chester picked some tips for y'all. Like I says last time, Chester ain't no talker, so I'm here to do the writin'. Now, I knows you ain't had much time to send in tips since last month, but we can't be doing this service for all you sweethearts out there without your help. So send in a tip, honey, so we can keep this steamboat rolling. Chester and me, we want this to keep afloat. We can use the money for hosting this here column, and you won't make out so bad yourself. This mag will send you $100 for every tip you give us. So get the lead out of them undies of yours and send in some tech stuff Chester can use. He'll pick 'em and I'll sort it all out for him. In the meantime, we got that dear editor to stick in another tip, and we got a goodie from ol' Paddy. So here's y'are.
Somebody dropped a MySQL table. Duh. Fire your DBA. If you can't fire the DBA, then this tip helps. —Chester
You are a MySQL database administrator. You take regular backups of your MySQL database. Somebody drops a table critical to the MySQL application (for example, the “accounts” table in a SugarCRM application). The MySQL application no longer works. How can you recover from the situation?
The answer is MySQL binary logs. Binary logs track all updates to the database with minimal impact on database performance. MySQL binary logs have to be enabled on the server. You can use the mysqlbinlog MySQL command to recover from the binary logs.
A better and more comprehensive solution is to use the Zmanda Recovery Manager (ZRM) for MySQL (MySQL backup and recovery manager). The mysql-zrm tool allows users to browse the binary logs and selectively restore the database from incremental backups:
# mysql-zrm --action parse-binlogs --source-directory=/var/lib /mysql/sugarcrm/20060915101613 Log filename | Log Position | Timestamp | Event Type | Event /var/lib/mysql/my-bin.000015 | 11013 | 06-09-12 06:20:03 | Xid = 4413 | COMMIT; /var/lib/mysql/my-bin.000015 | 11159 | 06-09-12 06:20:03 | Query | DROP TABLE IF EXISTS `accounts`;
Here we're doing selective recovery for incremental backups without the DROP customer table from the SugarCRM database. Do two selective restore commands to restore from the incremental backup done on Sept 15, 2006, without executing the database event DROP TABLE at log position 11159:
# mysql-zrm --action restore --backup-set sugarcrm \ --source-directory=/var/lib/mysql/ sugarcrm/20060915101613/ \ --stop-position 11014 # mysql-zrm --action restore --backup-set sugarcrm \ --source-directory=/var/lib/mysql/ sugarcrm/20060915101613/ \ --start-position 11160
See the Zmanda Recovery Manager for MySQL for more information: mysqlbackup.zmanda.com. —Paddy Sreenvasan
Sometimes it don't make sense to assume upgrades are a good thing. Run partimage to save an image of your old version first. If the new distro version don't work, you can run partimage to put the old one back. —Chester
I run multiple distros for various reasons. For example, I run 32-bit Kubuntu and 64-bit Kubuntu. I spend most of my time using 64-bit Kubuntu, but some packages are easier to set up and use on 32-bit Kubuntu, like Skype, for instance.
I recently decided to upgrade my 32-bit Kubuntu from Dapper to Edgy. Whenever you upgrade, you run the risk of breaking some existing programs. So I usually boot to another distribution and use partimage to save an image of the partition with the distribution I'm about to upgrade. If the upgrade doesn't go well, I always can use partimage to restore the partition to its previous state. There are many other reasons why you might want to save partition images, so you'll find this procedure useful even if you don't share my motivation.
Running Partimage on 64-bit Kubuntu AMD64
Partimage is finicky and refuses to run on a 64-bit system. For reasons beyond my knowledge, there is a partimage package you can install for Kubuntu AMD64, but it won't run. In my case, I want to boot to Kubuntu AMD64 and use partimage to save my 32-bit installation of Kubuntu, so the fact that partimage for Kubuntu AMD64 doesn't work is a major problem.
Or is it? It's actually quite easy to get partimage working on Kubuntu AMD64. Simply download the static binary form of partimage from www.partimage.org. Untar the binaries partimage and partimaged into /usr/sbin. These binaries should work fine even under AMD64. You should be able to type the command partimage at a root prompt to get it running. One would think it would be necessary to precede the command with linux32, but it works without it.
You should check to see if you have a /dev/dm inode before you use partimage. If you don't, you will be greeted with a screen like the one shown in Figure 1.
If nothing seems to happen when you press OK, partimage may not be able to create /dev/dm for you. Sometimes you can get past this screen by pressing OK several times, and partimage will work even if it doesn't create /dev/dm. Why take chances, though? Don't even start partimage until you create /dev/dm yourself with this command (assuming it's not already there):
# mknod -m 644 /dev/dm b 240 0
Now start partimage. Select the partition you want to save. In my case, this is partition /dev/sdb8. Then, enter a full path to the file where you want to store the image. I like to include the distro type, filesystem type and partition in the filename so I can remember why I created the partition image. The filename I used in this case is dapper32-ext3-sdb8.img. See Figure 2 for the example. The path /storage/disk/images points to a partition where I have lots of extra disk space for saving partition images.
Press function key F5 to continue. I use the default compression method, gzip, as it is much faster. If you are tight on disk space and don't mind waiting, you can choose bzip2 for the compression method. Partimage will check the partition and let you enter a description by default. I usually uncheck the description feature because the description is in the filename, but you may want to use the feature. Uncheck the feature by using the arrow keys to highlight it, and then press the spacebar to toggle to unchecked. You can see the screen with my choices in Figure 3.
Press F5 to continue. Partimage should get busy checking the filesystem. Partimage can be flaky and sometimes reports errors that do not exist. If you have this problem, check the partition manually (with fsck.ext3, for example), and then uncheck the option to have partimage do it for you. If everything went well, you should see a screen something like the one shown in Figure 4.
Press Enter, and partimage will create one or more compressed image files of the partition. The rest of the process is self-explanatory.
Note that partimage adds numbers to your filename, because it prepares to split up the image into multiple files if necessary. Even if it needs only a single file, it will change the above filename to dapper32-ext3-sdb8.img.000.
It's now safe to boot into 32-bit Dapper and upgrade 32-bit Dapper to 32-bit Edgy. If everything works, you're in business.
If you run into problems and feel like you need to downgrade back to Dapper, all you have to do is boot back into 64-bit Kubuntu (or whatever other distro you were using) and run partimage again. This time, highlight the partition, type the same image filename (remember to add .000 to the name), but use the arrow keys to select Restore partition from an image file, and press the spacebar to select it. See Figure 5 for an example. Press F5 and the rest of the process should be self-explanatory. If partimage created multiple files ending in .000, .001 and so on, you don't have to worry about specifying them all. It will find the extra image files and restore them automatically.
Partimage works with many filesystems, but some of them have only beta support. Use partimage with filesystems like JFS with caution. It has worked for me, but that doesn't mean it will work for you. If you want to save and restore XFS filesystems, you should bypass partimage and use the XFS utilities xfsdump and xfsrestore, designed for saving and restoring partitions. —Nicholas Petreley
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Linux Systems Administrator
- Validate an E-Mail Address with PHP, the Right Way
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- RSS Feeds
- Senior Perl Developer
- Technical Support Rep
- Introduction to MapReduce with Hadoop on Linux
- Weechat, Irssi's Little Brother
- What the author describes
9 min 58 sec ago - Reply to comment | Linux Journal
4 hours 20 min ago - Reply to comment | Linux Journal
5 hours 5 min ago - Didn't read
5 hours 15 min ago - Reply to comment | Linux Journal
5 hours 20 min ago - Poul-Henning Kamp: welcome to
7 hours 31 min ago - This has already been done
7 hours 32 min ago - Reply to comment | Linux Journal
8 hours 17 min ago - Welcome to 1998
9 hours 5 min ago - notifier shortcomings
9 hours 29 min ago
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?









Comments
partimage problem
On my workstation running Ubuntu 9.x I had no problem (running Partimage) but on my server running ver. 7.x I got the error which this line (from above) fixed:
mknod -m 644 /dev/dm b 240 0
Thanks a lot for the command (could not figure it out from the man files, those man files are for the birds man, pretty useless to me)!
Thanks about 2 and half hours! ;-)