Blogging to Nowhere

Tips

Online Filesystem Resizing with LVM

by Rob Connolly on Oct.10, 2009, under Tips

I use LVM on my main desktop machine. This is awesome because it allows me to dynamically allocate space to partitions as I choose, however I always forget how to do a resize, so I’m going to write it down here. This isn’t going to be a full LVM tutorial (there’s plenty of material out there for that), although maybe that’s an idea for the future.

The following commands will resize an ext2, ext3, or ext4 filesystem running on LVM while it is mounted:

$ sudo lvresize -L +XXG <path to fs device>
$ sudo resize2fs <path to fs device>

In the above command you need to replace XX with the number of GB you want the filesystem to grow by and <path to fs device> by the device node (typically /dev/mapper/something).

An there you have it, done! Obviously there is a huge amount more you can do with the two tools above, take a look at their man pages for more info.

Hopefully this post will save me from having to work out how to do this every time!

2 Comments :, , , , , more...

Quickly change Debian repositories

by Rob Connolly on Jun.03, 2009, under Tips

Apt is awesome. Plain and simple.

But it is kinda static. By this I mean it’s not particularly suited to environments where things change frequently. For example, we have a local mirror at uni, which of course it much faster than using the external Ubuntu or Debian ones, however as this is only available from internal University of Auckland IP addresses I would have to change my /etc/apt/sources.list file if I wanted to install something from home.

Today I knocked together a quick Python script to fix this, all it does is basically manipulate a symlink which points to the real /etc/apt/sources.list file, but I thought I’d share it anyway: (continue reading…)

Leave a Comment :, , , , , more...

Screen switching on the EeePC

by Rob Connolly on Feb.12, 2009, under Tips

I spend a lot of time working on my EeePC 901 using it’s external monitor support, it’s great, I have this little netbook, but when I plug it in to an external monitor, keyboard and mouse it pretty much turns into a desktop PC. The only drawback I’ve found so far is that there was no way to switch between the monitors in Ubuntu without going through the Screen Resolution configuration dialog. That was until I decided it had annoyed me for long enough and got Googling.

I found this page, which documents the Xrandr, which can be used to configure monitors and screen resolutions from the command line. Some of the code snippets on the page got me into writing a script, which could toggle between the displays and be assigned to a hot key. I also added a mode to switch back to the laptop screen when there is not external screen (just in case my external monitor dies as happened in the power cut the other day!). (continue reading…)

Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!