(TL note: nareshov's diary)

Archive for the ‘Linux/BSD’ Category

On resizing filesystems and LVM2 logical volumes

leave a comment »

I’ve been using Debian squeeze/sid for a while now (with apt-pinning) and for the past few days I’ve been facing the “no space left to write” problem. I used the default LVM2-based disk partitioning scheme offered by the Debian installer. I thought it was okay to have a 6.5G root partition and the rest for the swap and my home partitions. Looks like 6.5G wasn’t enough for me. And the root and home partitions used the ext4(!) file-systems.

Now, here’s how you go about reducing your home’s size and increasing your root’s size.

  1. Reduce the filesystem size of the partition which has enough free space to spare using resize2fs.
  2. Then reduce the logical volume in which this filesystem resides using lvreduce.
  3. Now extend the logical volume in which the “starving” filesystem resides  using lvextend by the same amount you used in step 2.
  4. Then simply issue resize2fs /dev/VGNAME/LVNAME which should simply fill up the unallocated space in the logical volume it resides.
  5. (optional), if your reduced filesystem doesn’t mount due to a block-size mismatch, e2fsck it and apply step 4. to it.

Glad that it all worked out fine. I didn’t have to use a live cd to do this (was too lazy for that anyway). I dropped into a vt, unmounted my home (which has the “important” data) and performed steps 1 and 2 on it. My root was still mounted while I did steps 3 and 4 on it.

Written by Naresh

November 13, 2009 at 12:41 pm

Posted in Linux/BSD

Tagged with , , , , ,

Playing with LISP on Debian Squeeze

with 2 comments

I haven’t looked up at how you play with LISP using Vim. Not really interested either since I’m committed to Emacs *rolls eyes*.
So, assuming you’ve already done aptitude install emacs23, Let’s go ahead and aptitude install sbcl cl-asdf slime. When in doubt aptitude show sbcl or aptitude show cl-asdf.

My motivation for this post in the first place was to document the quirks with the installation I was facing last night. If you happen to notice the following with the above aptitude install:

Setting up cl-asdf (1:20090819-3) ...
Reinstalling for sbcl
Recompiling Common Lisp Controller for sbcl
/usr/lib/common-lisp/bin/ loading and dumping clc.
; loading system definition from /usr/lib/sbcl/sb-grovel/sb-grovel.asd into
; #
; registering # as SB-GROVEL
; compilation unit aborted
; caught 1 fatal ERROR condition

Error running init-common-lisp-controller-v4: Lock on package SB-IMPL violated
when interning NATIVE-FILE-KIND.
See also:
The SBCL Manual, Node "Package Locks"
mv: cannot stat `sbcl-new.core': No such file or directory

Done rebuilding
Setting up cl-swank (1:20090908-1) ...
Setting up emacs (23.1+1-4) ...
Setting up sbcl (1: ...
/usr/lib/common-lisp/bin/ loading and dumping clc.
; loading system definition from /usr/lib/sbcl/sb-grovel/sb-grovel.asd into
; #
; registering # as SB-GROVEL
; compilation unit aborted
; caught 1 fatal ERROR condition

Error running init-common-lisp-controller-v4: Lock on package SB-IMPL violated
when interning NATIVE-FILE-KIND.
See also:
The SBCL Manual, Node "Package Locks"
mv: cannot stat `sbcl-new.core': No such file or directory

Your slime setup isn’t going to be functional. Fret not. Read on.

From Debian BTS bug #549528

=======BEGIN PATCH===================
--- /usr/share/common-lisp/source/common-lisp-controller/post-sysdef-install.lisp.orig 2009-10-21 14:42:00.000000000 -0400
+++ /usr/share/common-lisp/source/common-lisp-controller/post-sysdef-install.lisp 2009-10-21 14:40:59.000000000 -0400
@@ -61,7 +61,7 @@
(defun get-owner-and-mode (directory)
(when (eq :directory
- (sb-impl::native-file-kind (namestring directory)))
+ (sb-impl::unix-file-kind (namestring directory)))
;; check who owns it
(multiple-value-bind (res dev ino mode nlink uid gid rdev size atime mtime)
(sb-unix:unix-stat (namestring directory))
=======END PATCH=================

Followed by,

dpkg-reconfigure cl-asdf
dpkg-reconfigure sbcl

Append the following to your .emacs, if you haven’t already.
;; Slime
(add-to-list 'load-path "/usr/share/common-list/source/slime/")
(setq inferior-lisp-program "/usr/bin/sbcl")
(require 'slime)

And your Emacs is ready to roll.

Written by Naresh

November 8, 2009 at 10:57 pm

Posted in Emacs, Linux/BSD, Software

Tagged with , , , , , ,

Updates as of 23rd Oct. ’09

leave a comment »

I don’t know if it’s just me but there are these days in an week where I tend to worry so much that my productivity drops to near-stagnation. Just nothing seems to happen other than a tense me appearing tense. Anyway, I’m just recovering from a somewhat unhappy experience with my Karmic Beta installation on my laptop. Yes, it’s another ooh-nareshov-does-another-distro-shift post. And here’s what happened.

First, I get a call from Vadiraj on a Wednesday morning, out of the blue, from Goa. Apparently, his friend and he planned a noon-trip to this place just to score something that’s allegedly only available there (in India, i.e.). He wanted me to do a quick Google to give him some pointers. Unsuspend my laptop, I did. To connect to the internet through my USB modem, it failed. No matter what I tried – wvdial, pppd, NetworkManager – I couldn’t connect. And I went on a reboot-and-try spree. No luck. All that happened was me end up with a laptop that’d get stuck at boot trying to fsck my filesystem. Enraged, I was.

I reach office and start moving my stuff off of my laptop preparing for a fresh-install. Of, *shudder*, Arch Linux. Installation was pretty straight forward. But I didn’t really enjoy it as much I did Gentoo or FreeBSD. Not to mention all that sorcery trying to get my USB modem to work being unsuccessful. (At some point I had udev identifying my device as a CDMA modem and hal identify it as a GSM modem).

That night, no internet. The next day, installed Debian testing. But I had the same darned problem of being unable to tap my touchpad to click on, you know, things. The GNOME which Debian-testing featured didn’t have that tab under System > Preferences > Mouse where I could enable “Tap to click”. A quick Google suggested the use of GSynaptics – which had a “Tapping” tab where I promptly enabled “Enable Tapping” and had my Aha-moment.


Oh, and, today I get a pay-your-internet-bill reminder. And I did it within minutes of seeing this. And here I am, about seven hours after I did that and back from a pretty decent string chamber orchestra organised by the Bangalore School of Music for raising funds for the Karnataka-floods relief, blogging about why my USB modem wasn’t working and the things I did in the past few days.

And regarding my worries. Wanda the Fish, the fortune teller had this to say:

First thing Wanda, the fortune teller, said.

First thing Wanda, the fortune teller, said.

P.S.: That was my first click on the Wanda-the-Fish GNOME applet after installing fortune-mod earlier today.

P.P.S.: On the upside, I got a chance to do a fresh ext4 install after all this.

Written by Naresh

October 23, 2009 at 11:32 pm

On Karmic Beta

leave a comment »

On Friday last week I happened to upgrade certain packages on my erstwhile Jaunty installation on my laptop. For some strange reason my touchpad ceased to work. I couldn’t move the mouse pointer. I couldn’t even get onto good ole’ Google because I couldn’t click on NetworkManager and select the radio button next to my CDMA USB modem entry!

The next day I issued a ‘do-release-upgrade’ and headed out to watch Tarantino’s “Inglorious Basterds” with Debayan and Vignesh. After I returned there was still an hour to go and so I continued to bootstrap my Debian-armel on the SD card for the Beagle board. And when it was all over, I had Karmic!

So, the touchpad worked now. Somewhat. I couldn’t tap on the touchpad to click on things like the menubar entries and so on. Turns out that Systems > Preferences > Mouse > Touchpad has a button which says “Enable mouse clicks with touchpad” disabled by default. I, on the other hand, could make my way through up to this point with the keyboard alone and enabled it. Phew.

The improvements from Jaunty are, as expected, quite a lot. And visibly so.

Take the shiny new 2.6.31 kernel, for example. It boots fast. And supports kernel mode setting for the revamped X. The improvements are so obvious that you can’t afford to not say “wow”. I haven’t done the “full-screen flash video” test yet, but I do like the snappiness when I switch between virtual consoles and X. Once again, I can live with the minimal compiz that’s turned on by default on an Ubuntu installation. Oh, and I did have another oh-that’s-new moment with the volume control. It doesn’t look like the old one but it does look like an incomplete version of the Windows 7-style volume manager. I couldn’t find a way to mute my laptop speakers and let all sound be audible only via my earphones. Thankfully, alsamixer works.

UPDATE: It turns out that selecting “Analog Headphones” under Sound Preferences > Output does the trick.

So far so good. Upgrading moar. Oh, and don’t forget ‘do-release-upgrade -d’ in a screen session. Also, E17 looks kickass.

Written by Naresh

October 8, 2009 at 7:56 pm

On how weechat handled a downloading file

with 4 comments

Something really interesting happened on one my workstations which had this weechat IRC client running on it.

Weechat is this irssi-based IRC client for use on a Linux console. The features page lists certain interesting ones and while I first chose it over irssi, the compelling reason was proper proxy support (authenticated ones). I had little idea on how the “FIFO pipe for remote control” would be helpful- until this happened this morning:

I’m usually connected to the Freenode and Rizon networks. Rizon is primarily the japanese-animation/drama hub for various fansubbing groups. Mostly used for co-ordinating among fansubbers and providing XDCC leech bots. So, here I was, leeching an episode off of a particular bot, and not realising that the download had completed, I moved (mv) the file from the default download location (~/.weechat/dcc) to the approriate directory (~/Backups/Videos/Film). This I did, on another console within screen, I switched back (C-a C-a) to the console where weechat was running and was surprised to see that the file I thought had completely downloaded still going down around 98%. Shocked, I `ls -l ~/Backups/Videos/Film` and get even more shocked to see that the file-size of this moved file had grown a bit. What was happening here? When my disk is out of space and a download breaks due to that, I’d see a “broken pipe” message in the log window, so what happened here, I think, is what they mean by “FIFO pipe for remote control”. Even after I had moved an incomplete, currently downloading file to a new location, the download continued without any usually expected re-actions one would see with software on Windows or software such as LinuxDC++ (locked files).

That was an interesting experience and an interesting feature I’d love to see in more software. Good job, weechat. Copy-pasting off a weechat window is sort of stupid, though, owing to the nicklist on the right and fancier formatting. Overall, it’s been good.

Written by Naresh

November 25, 2008 at 8:28 am

Updates as of 1st September, ’08

with 2 comments

Been out of the blogging scene for a few months now.

Lot of things have happened so far. I’ve got into the fansubbing scene and I’m part of a group a bunch of us started. I do a little bit of translation and video encoding.

Just saw episode 21 of Code Geass R2 and Soul Eater. Very thought-provoking. It’s great how anime in general can satisfy all kind of audiences. I mentioned this to a friend of mine who replied saying, “but most of them suck”, to which I replied without even thinking, “that’s because those don’t satisfy you ^^”

Hoping to see more people appreciate anime, especially those in my campus. And, yeah, hoping that I stop getting those “Jesus loves you” spam.


P.S.: I’m tired of running Linux/BSD on my laptop. I’ve moved onto Vista now. I’ll leave Linux/BSD where it belongs – in the CC server room.

P.P.S: So many tags and categories to deal with, it’s getting random now.

Written by Naresh

September 1, 2008 at 1:29 am

Exploring OpenSUSE’s KDE Desktop – 1

leave a comment »

After the installation earlier it was time to get KDE4 up. I’ve noticed that OpenSUSE has been one of the first ones to provide KDE4 packages in 2007 itself. It has a strong and large KDE team. First I had to update OpenSUSE. This involved adding three repositories using zypper:

zypper ar suse-oss

zypper ar suse-non-oss

zypper ar suse-update

as explained in But wait, don’t do that! seems to be the default mirror and possibly a large number of people are using it without realising that it terribly slows down things for everyone. The right thing to do would be to use a mirror close to you. Look at and use the right one. So, with the above supported official repositories I updated my system, it required two updates – one to fix zypper and the next to boot a newer kernel and other libs. Next task was to fix mp3 support in Amarok’s xine. This required the Packman repo:

zypper ar suse-packman

– note that I’ve chosen a different mirror from the one mentioned by default in I kind of understand that OpenSUSE (like Fedora) are very careful when it comes to patented/licensed stuff unlike Kubuntu where mp3 support and the like can be easily pulled in from non-free repos in the same mirror. I haven’t added anymore repositories as I fear breakage. For KDE4 I added the repositories as listed in Again, I used a mirror. That means I couldn’t use the one-click .ymp installer. I manually looked into the .ymp files and installed it off of Yast2. If you’re running an amd64 installation like I am, you’ll probably encounter “RPM dependency hell” when you’re trying to install a KDE4 package through Yast. Fear not. In YaST2’s menu, click on Package > All Packages > Update if newer version available. Do that first and then modify your KDE4-DEFAULT.ymp to use your mirror site and install off of it. Now I shall talk a bit about KNode – a newsreader for KDE. While I love its functionalities (mark cross-posts read in other groups on their first encounter, …) more than any other newsreaders out there, it’s funny and annoying while I’m configuring it the first time. I’m referring to its Account Setup dialog box: KNode's Accounts dialog box is a big joke So, here’s when the fun starts. Focus on the “Server” text field and try pressing TAB. What do you expect? Go to the “Port” field? No! Keep pressing TAB and go crazy >_>

Next, I tried OpenSUSE’s Akregator. Earlier on Kubuntu it was nice reading the various default feeds (mostly planets of Ubuntu, Kubuntu, KDE, Debian…). OpenSUSE’s default feed selection looks good. Notice the security feeds! (Look carefully, “Affected products”, OpenSUSE isn’t listed!) OpenSUSE's Akregator default feeds That’s all for now! More later.

Written by Naresh

April 10, 2008 at 3:44 am