Notatypewriter's Blog

Umm… what?

Archive for May 2011

Being a Debbie Downer

leave a comment »

(I have a tendency to do this, but I’d like to think it keeps me prepared for the future.)

I stumbled across this site called They Don’t Teach You This In School. It has decent advice, mostly New Age-y follow your dreams stuff but some other more concrete stuff too.

There’s an article inspired by a commencement speech at Stanford given by Steve Jobs. Thanks to Longreads, I recently read this speech and found it had lots of good pragmatic advice.

But in the TDTYTIS article, the author writes (emphasis added):

He says that being diagnosed with cancer and coming that close to death has led him to start every day thinking like it’s his last. If it’s your last day on earth, you want to be doing something you enjoy, right? So if he wakes up in the morning, and decides that what he is about to do that day isn’t what he would like to do on his last day, he will do something different. Isn’t this how we should all live our lives to ensure we get the most out of them?

But actually, Steve Jobs says something very different (emphasis added):

When I was 17, I read a quote that went something like: “If you live each day as if it was your last, someday you’ll most certainly be right.” It made an impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: “If today were the last day of my life, would I want to do what I am about to do today?” And whenever the answer has been “No” for too many days in a row, I know I need to change something.

TDTYTIS changed Jobs’ message from pragmatic advice to probably foolish advice. I’m sounding like a Debbie Downer when I write this, but not every day’s itinerary is filled with things that you want to do before your last day on Earth. Sometimes you have to go to work and sit through that boring meeting. Sometimes you have to smile at people and humor their queries. Sometimes you have to have lunch with your mother.

Steve Jobs recognized that some days will suck. So his advice was to consider the big picture. Not to live every day as if it was his last, but to make sure he never spent too much time not doing the things he wanted to do and to every so often, live at least one day as if it was his last.

That’s the better advice… at least to my personality.

Read the rest of this entry »

Advertisements

Written by notatypewriter

2011 May 29 at 6:38 am

Posted in Thoughts

Tagged with , , , , ,

Huh?! I didn’t run out of disk space…

with one comment

Windows destroyed my partition table a couple weeks ago, so I had to reinstall Ubuntu and recreate my somewhat complicated dm-crypt+LVM partition layout. This gave me an opportunity to reformat my partitions.

The Ubuntu (and Debian) alternate installer presents the user with a choice for usage scenarios: standard, news, largefile, and largefile4. These let the user choose how many inodes to create for that partition, which limits how much space is used by inodes. Each inode is 256 bytes. But since ext{2,3,4} uses one inode per file or directory, it also puts an upper limit on the number of files in the filesystem.

Usually, the larger your files, the fewer inodes you want to create. If you have large files, you’ll run out of space before you run out of inodes, so you want more space and fewer inodes.

I chose largefile4. I was copying some of my backed-up data back onto the partition when I got an error “no space left on device.” I was pretty confused. I was only copying 8.2 GiB of stuff onto a 82 GiB partition. Turns out it was because I ran out of inodes. The largefile4 option created only 21141 free inodes and I had 24319 files in this set of data. The largefile4 option was obviously a bad idea. This data was mostly jpegs, so the file sizes were much too small to take advantage of the fewer inodes.

After reformatting each filesystem, I ran tune2fs to list the number of inodes available for use (Free inodes value). You can see the ratios used by looking in /etc/mke2fs.conf. Here were the results for the same partition (containing 21657600 4096-byte blocks for a total size of 82 GiB):

largefile4: 21141 = 5 MiB = ~0% usage
largefile: 84597 = 20 MiB =  ~0% usage
defaults: 5414901 = 1322 MiB = 1% usage
news: 21659637 = 5288 MiB = 6% usage

I haven’t picked which one to use yet, but it’s down to largefile and defaults. 1322 MiB is almost a whole movie file. Or I could always specify an inode_ratio in between…

UPDATE: I settled on an inode_ratio of 262144 which gives me 338421 free inodes, which is about 80 MiB. Very little usage yet lots of files. 🙂

Written by notatypewriter

2011 May 18 at 7:07 pm

Posted in Nerding out

Tagged with , , , , ,

%d bloggers like this: