Wednesday, September 30, 2009

LVM Disk Recipes for Debian

After much wrangling and researching I finally figured out how to get LVM disk recipes to work with Debian preseeding. The following recipe will create a partition layout of what's in the table. When making these recipes make sure that you account for extra whitespace that may be hiding (especially spaces) otherwise it may yield unexpected results.


Mount PointTypeVGLV NameSize (MB)Filesystem
/bootPrimary100ext3
/LVMvg00/dev/vg00/rootvol4096ext3
/varLVMvg00/dev/vg00/varvol1024ext3
swapLVMvg00/dev/vg00/swapvol2048swap
/homeLVMvg00/dev/vg00/homevolremaining spaceext3


Recipe file:



Ubuntu/Debian Custom LVM Disk Recipe ::

100 1000 100 ext3
$primary{ }
$bootable{ }
device{ /dev/sda }
method{ format }
format{ }
use_filesystem{ }
filesystem{ ext3 }
mountpoint{ /boot }
.

100 100000 -1 lvm
$primary{ } $defaultignore{ }
method{ lvm } vg_name{ vg00 }
.

4096 10000 4096 ext3
$lvmok{ } in_vg{ vg00 } lv_name{ rootvol }
method{ format } format{ }
use_filesystem{ } filesystem{ ext3 }
mountpoint{ / }
.

1024 4000 1024 ext3
$lvmok{ } in_vg{ vg00 } lv_name{ varvol }
method{ format } format{ }
use_filesystem{ } filesystem{ ext3 }
mountpoint{ /var }
.

2048 5000 2048 linux-swap
$lvmok{ } in_vg{ vg00 } lv_name{ swapvol }
method{ swap } format{ }
.

1024 1000000 -1 ext3
$lvmok{ } in_vg{ vg00 } lv_name{ homevol }
method{ format } format{ }
use_filesystem{ } filesystem{ ext3 }
mountpoint{ /home }
.

Friday, December 05, 2008

SATA Drive Power Management in Linux

I recently purchased a new 1TB HDD for a new power efficient server I built and I wanted to share a few of the power saving tips I discovered after reading a few sites.

File system

I was originally going to use ext3 for compatibility reasons, but after reading into JFS more I found that it's lighter on CPU and a bit more power friendly, so I used it to format this new drive. I also disabled atime and diratime within /etc/fstab.

/dev/mapper/jezebel-homevol /home jfs noatime,nodiratime 0 1
hdparm

Many newer drives support advanced power management on the drive itself, mostly at the sake of performance but since this is a data drive that sits idle most of the time the hit is negligible.
sudo hdparm -M 128 /dev/sdb
sudo hdparm -B 100 -S 240 /dev/sdb
The first will enable Acoustic Mode and the second will set spin down after 20 minutes of idle time. You can make the permanent by adding them in /etc/hdparm.conf.

Kernel params

Most of these tricks are for laptops, but they work just as well on an always-on server by enabling them in /etc/sysctl.conf.

#Specific Flash and Power Tweaks
#
#Set Laptop mode for less disk writes
vm.laptop_mode = 1
#
#Set Dirty writeback higher
vm.dirty_writeback_centisecs = 1500
vm.dirty_expire_centisecs = 1500
vm.dirty_ratio = 25

#
#Set swappiness
vm.swappiness = 20
Swappiness is set lower than default to keep swap around in case it's needed but to not use it very much.

Friday, November 07, 2008

A Dark Cloud

Something I wrote on Nov. 5th:

Today we stand as one nation to lift up our first black President of the United States. The road that was paved with the blood of so many has led us to this point in history, the monumental moment cannot be overstated. Barack Obama is our 44th President and the culmination of so many hopes and dreams. From his grandmothers love to Dr. Martin Luther King Jr’s sacrifice President Obama now stands as the validation for so many embattled souls. I am proud to be an American, I am proud to have been part of such a historic event. The chant “Yes we can” will forever be emblazoned into our hearts and minds. As I watched President Obama’s speech I could only marvel at the significance, trying to soak in every moment. Imagining what it will be like to speak of this moment to my grandchildren I felt lost in a sea of joy and honor. The United States of America is truly great.

However a small black cloud hangs over those of us waking up in California. With only the smallest of margins the constitution of our great state is now exclusionary to gays and lesbians. This morning I can only imagine the sorrow of those families who are so personally touched by this injustice. It angers me that on this great day California has chosen to take a step backwards. Marriage, first and foremost, is about love and commitment. Yet it is apparent that many people hold gender to be a much more significant factor when defining marriage. There is much to be said about this, but one word embraces my true feelings. Disgraceful.

Tuesday, November 04, 2008

Why Today is Importatnt to Me

In 2004 I had just moved to California with my brother. The Iraq War was in full swing and starting to take a turn for the worst, it was constantly rainy in San Diego, and I had just started a job that I wasn't sure would go anywhere. That Nov 2nd I stood in in with my brother while it rained on us and my fellow citizens. For the rest of the day I followed the election online while at work, listened to Air America on the drive home and heard Jeananne Garafalo and her co-host strain for some optimism of the results while the rain kept falling. I watched the cable news networks call each state, and had some glimmer of hope when it came down to Ohio, but early in the morning of Nov 3rd it was considered over. All the while I was reading forums and boards online, feeling even more distraught by the things my fellow citizens were saying. Seeing them cheer and celebrate the re-election of who turned out to be the worst president in the history of our nation.

This year is different. There is no rain, my career is in full gear, I have a wonderful supportive girlfriend, and things overall are better. Unfortunately for our country things are getting worse, the result of 8 years of unabashed hubris on the part of our leadership and those who followed. Our economic situation is considered dire and with the way things are going there's not much to look forward too.

But that will change tonite.

After following the election cycle these past months I am confident that tonite will be historic, and Barack Obama will be our 44th president. Even with all the problems we as a nation face at this moment, his campaign has delivered on it's promise: Hope

I know that tomorrow will be a better and brighter day, and that we as a nation can come together and climb back up that hill to shine unto the world.

Update: It actually is raining, which for the most part is pretty nice and doesn't dampen my spirits at all.

Tuesday, October 28, 2008

Daily Election Websites

As the election is wrapping up this week I thought I'd share the sites that I follow daily on determining of how this election is going.

I have most of them in google reader which makes it nice and concise to go over in the morning and afternoon.

Saturday, October 25, 2008

My Moleskines

Over the past few years I've had a variety of different Moleskine notebooks that I've used for many purposes. Some were just for random notes and lists, while others were for more specific activities like Fantasy Football or wine tasting. Because of the infrequent use and just grabbing whichever one I could they're mostly sporadic and difficult to find anything other value other than flipping through the entire thing. Since starting at Qualcomm though and having a development goal of better time management set, I decided it was time to get serious about some type of organization for notes.

I first started by reading the excellent O'reilly book Time Management for System Administrators. The author has his own "Cycle System" that he uses to keep track of his daily tasks, appointments, and long term projects. While the system itself is easy and fleshed-out I found that it wasn't exactly tailored to my needs. I did take a lot of his ideas and work them into my use of Moleskine notebooks that are relatively simple yet have some nice features (durable covers, elastic binding band, cloth bookmark, and back pocket). Below is what I did to customize and tailor them to my needs professionally and personally.

The Notebooks

In the book there are three areas the author focuses on; To-do Lists, Appointments, and Goals. Now because the specific notebooks I like to use (either lined or graph paper) do not have a calendar built-in I skipped the appointment portion, and instead rely on Google Calendar for personal and Outlook Calendar for professional date keeping. I also didn't like the idea of keeping both personal and professional in the same notebook and therefore split them up into two different notebooks. My personal notebook is a squared soft-cover, which is smaller than a regular size and fits perfectly into my back pocket. My professional notebook is larger hard-cover lined variant that travels well in my laptop bag and works well for larger notes. The two follow the same criteria for my needs however.

Structure

I wanted to keep the setup simple and similar for both of them and generally stuck to the same format for both. I've read about many Moleskine Hacks and took some ideas, but most of them were too complex and involved for me to use, I just want something simple. Here's how I've set mine up:

  • Three Sections: To-do, Notes, Ideas (only in personal) and Goals marked with sticky labels
  • Initial date written inside front cover and on side with black marker
  • Every odd page numbered
  • Table of contents on inside cover with the odd page and short description
That's it! The only real difference is the personal one has an Ideas section as well, which is for longer more drawn out thoughts than just a standard to-do list or jotting down notes. Each one has the last few pages reserved for both life and career goals and an estimation of when I'd like to complete them. In general there's not specific page format for my personal one, I just put things down in the proper section and if they're important mark them on the TOC.

Professional Format

My professional one however does have a specific format for the to-do pages which I semi-copied from the time management book. I first date the top of the page, then split the first third of te page into a general todo and project list. Every morning when I first get into work I lay down my todo list, adding new items from our ticket system or email. Each todo item is then assigned a value (A, B, C) depending on it's priority and I get to work, crossing them off as they are done. The ones that aren't done at the end of the day are then moved to the next days list and marked with a - to show they were moved. The projects side is more just to keep in mind what I'd like to accomplish in a more long term sense. The second third of the page is for general notes, small scribblings on something I'm working on, random commands, etc. The final third is a ad-hoc schedule that I just fill in with times for meetings and other appointments that I have during the day. I don't fill any out ahead of time since I let my Outlook calendar keep track of recurring meetings and appointments.

Here are some pics:

Personal notebook on top of professional one

Sticky labels denoting sections
Table of Contents
Side date label

To-do page layout in professional notebook

Friday, October 17, 2008

Positions

Earlier tonight I took a survey on how well my positions match with those of Barack Obama and found that I match him about 56% of the time. During the survey I noticed that some of the questions were awkwardly worded and I didn't have a clear answer to give. Reading them though made me start thinking about where I actually stand on most of the issues presented in this election cycle and inspired me to put them down in writing.

Separation of Church and State - Favor

Religion should have no place in government. There are too many creeds and opinions based off ideological faith and they have no business influencing laws that govern a diverse group of people. This is my main justification for my positions on Abortion and Gay Marriage. To me government should rule with a secular hand and if a politician has personal values that's fine, just as long as they focus on what's best for society. I also believe that the founding fathers when establishing American democracy had this in mind.

2nd Amendment - Favor

I strongly believe in the Constitution and therefore support the 2nd Amendment even though I'm not in favor of guns themselves. I understand the need for personal protection and the reason the founders made this amendment in the first place, to give the citizen the power of strength to overthrow a government turned to tyranny. I am however in favor of gun control and laws that restrict possession and use of certain weapons in private hands. Guns are dangerous, and having to pay a tax or undergo a background check is nothing that a private citizen who has no intention of committing harm should worry about. This, in my opinion, does not violate the 2nd Amendment.

Abortion - Favor

I firmly believe that abortion is a manufactured religious distraction of other issues that are more important, and therefore is something that shouldn't even be a factor in the political process. Unfortunately many people see this as a single issue vote and therefore it's a popular issue, especially among Christian voters. I do not favor the actual act, and would like to see more education and counseling requirements before the procedure is done. The only reason I am in favor is I know that without legal constrictions the consequences would be even worse.

Taxes - Raise 'em

I never really understood the anger people have when it comes to paying taxes. Contrary to popular belief Americans live in a society of other people. Regardless of how much an individual thinks they contribute back, society does even more. The benefits of taxes are almost impossible to measure and therefore many people think they are treated unfairly when they have to pay them. The downside is that government may misuse funds (cough cough Iraq war) but taxes still provide more good for citizens than most would like to believe. To me this is not an issue of freedom but of individual responsibility to the society that supports you.

Censorship - Unfavor

Swear words, sex, nudity, reality. Explicitly trying to stop someone from seeing someone because you deem it inappropriate is a threat to the individual. It is an individuals choice what they want to see and don't see, and if that individual is a minor then it is the parents responsibility. Government should have no interference with it thinks people should see and shouldn't see.

Healthcare - Give it to 'em

Preventative medicine is the best medicine. Instead of fixing the problem as it occurs it's better to treat it before it breaks. Vaccinations, yearly physicals, health evaluations are all cost effective and save money down the line by avoiding expensive procedures to fix bigger problems. This works for any type of mechanical maintenance and to claim it doesn't for health maintenance is naive.

Gay Marriage - Favor

In step with my above positions on Abortion and Separation of Church and State I also believe this is another manufactured distraction to take away from other issues. The Constitution protects rights and no amendment should take them away. Love is a universal and secular emotion, to deny a couple, regardless of sexual orientation, is a violation of natural laws.

Summary

I believe in a secular non-invasive government that provides essential services to both the individual and society. Most of my positions are considered to fall on the left side of the spectrum but I understand the value of balance and that not everyone thinks like I do. I believe that the American style of democracy is one of the greatest systems of government created and caters to this balance. Even with it's pitfalls I would not change any of the core ideas that our government was founded on.