Archive for the ‘Linux/BSD’ Category
On resizing filesystems and LVM2 logical volumes
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.
- Reduce the filesystem size of the partition which has enough free space to spare using
resize2fs
. - Then reduce the logical volume in which this filesystem resides using
lvreduce
. - Now extend the logical volume in which the “starving” filesystem resides using
lvextend
by the same amount you used in step 2. - Then simply issue
resize2fs /dev/VGNAME/LVNAME
which should simply fill up the unallocated space in the logical volume it resides. - (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.
Playing with LISP on Debian Squeeze
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/sbcl.sh 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
FAILED
Done rebuilding
Setting up cl-swank (1:20090908-1) ...
Setting up emacs (23.1+1-4) ...
Setting up sbcl (1:1.0.25.0-1) ...
/usr/lib/common-lisp/bin/sbcl.sh 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
FAILED
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 @@
#+sbcl
(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)
(slime-setup)
And your Emacs is ready to roll.
Updates as of 23rd Oct. ’09
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.
Phew.
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:
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.