Resizing ext3 partitions with parted

A while ago I wanted to enlarge my /home partition (hda6), as it was getting full. After that partition I had another (unused) one, which I intended to merge with hda6 and thereby increase the amount of free disk space on /home.

Here's parts of the disk layout:

hda6 Logical Linux ext3 30848.00
hda7 Logical Linux ext3 8848.00

So, merging hda7 into hda6 should be as simple as removing hda7, and then resizing hda6 to swallow up the 8 gig from the former hda7. Basically, that's how it worked, but I had a few problems. First, at that time is seemed impossible to simply resize ext3 partitions. Neither ext2resize, nor QtParted, nor parted worked for me for some reasons (maybe that has changed recently).

After some googling I finally found a way to do it (which I'll document here, maybe it'll be helpful for others):

  1. Boot from Knoppix, not mounting any partition
  2. Run fsck on both, hda6 and hda7 (optional?)
  3. Remove hda7 (e.g. using cfdisk)
  4. Remove the ext3 journal from hda6 (effectively turning it into an ext2 partition):
    # tune2fs -O^has_journal /dev/hda6
  5. Resize hda6 using parted. The xxxx is the original start of hda6 (you may not change that) and yyyy is the end of the disk:
    # parted
    (parted) resize 6 xxxxx yyyyy
  6. Enable the ext3 journal again on the now enlarged hda6:
    tune2fs -j /dev/hda6
  7. Reboot

But this didn't work from the beginning either — for some strage reason parted didn't believe me that the space after hda6 was free. It did display it as free space, but the "resize" operation complained.

So what I did was this (instead af the above step 3):

  1. Re-add the hda7 partition using, e.g., cfdisk
  2. Start parted, and remove hda7 again from within parted(!):
    # parted
    (parted) rm 7

It seems parted didn't like the way cfdisk removed the hda7 partition... very strange...

Draft: Debian GNU/Linux on a Toshiba Satellite A80-117

I intended to write up some sort of HOWTO for using the Toshiba Satellite A80-117 with Debian GNU/Linux for quite some time now, but I don't seem to get around to really finish it. So for now, I'll just release some quick hints about how to get everything working — I'll cover more details and stuff as soon as time permits.

Please consider this a draft and let me know if you have any comments.

(U)DMA On My Toshiba Satellite A80-117 [Update]

Toshiba Satellite A80-117

Sometimes funny things happen. I spent several hours yesterday, trying to figure out why my laptop is responding so darned slow. I suspected it had something to do with the hard drive and I found out quite quickly that (U)DMA was disabled, hence the CPU had to do all the work. OK, no problem, I'll just do a hdparm -c1 -d1 /dev/hda and everything will be fine. Or so I thought.

What I got was this:

setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
using_dma = 0 (off)

Which means DMA could not be enabled. I noticed an error message in the output of dmesg which seemed related: ide0: Speed warnings UDMA 3/4/5 is not functional. Some people had the same problems because they were missing the correct option in the kernel (mine is CONFIG_BLK_DEV_PIIX), but that was not my problem. After a few hours of googling and 6 or 7 kernel recompiles, I gave up and went to bed.

Now to the funny part: Today, John Choffee posted a comment about bashpodder in my blog. Curious as I am, I also visited his blog and in his "LinkFeed" box a tiny entry caught my attention: [PATCH] ich6m-pciid-piix.patch. Now guess what this patch (for Linux 2.6) does. It adds support for my specific type of IDE/(S)ATA controller, the "Intel Corporation 82801FBM (ICH6M)". Patch, recompile kernel, reboot, hdparm -c1 -d1 /dev/hda, bingo!

Here's the output of hdparm -tT /dev/hda:

Before the patch:

Timing cached reads: 2468 MB in 2.00 seconds = 1232.95 MB/sec
Timing buffered disk reads: 8 MB in 3.84 seconds = 2.08 MB/sec

After the patch:

Timing cached reads: 2624 MB in 2.00 seconds = 1312.20 MB/sec
Timing buffered disk reads: 88 MB in 3.00 seconds = 29.33 MB/sec

Thanks John, you're my personal hero today.

Update 2006-03-01: The URL for the patch is broken. This one works.

More Firewall / Iptables Script Updates

I have updated my iptables scripts again.

This time fw_laptop got support for limiting logging in case of flooding, blocking of known-bad IP addresses (e.g. from, optional blocking of certain outbound ports (e.g. X11 server, VNC, NFS etc.), and a few minor tweaks...

Thanks to Ryan Giobbi for several hints and comments. Further comments and suggestions are welcome! Offline / Donations Requested

The Drupal website has been down for two days now. They haven't received a response from support and hence cannot fix it (sounds familiar to me).

On the long run, Drupal will migrate to the Open Source Lab (OSL) which offers lots of services and already hosts many popular Open Source projects like Mozilla, Apache, and Debian.

To be able to do this, they need a new server (free rack space and bandwidth are provided by OSL) for which they are seeking donations now.
It's also planned to create a non-profit organization which will hold the funds, so the donations will be tax-deductible...

Syndicate content