Tag Archives: linux

Booting Linux on a 3TB disk with grub2

I recently purchased a 3TB disk for my home server.
All disks of size 2TB and above cannot be partitioned using the standard fdisk tool. They require a GPT partition table.
First of all install parted and gnu-fdisk (an fdisk replacement based on libparted):

apt-get install parted gnu-fdisk

Assuming the 3TB disk is sda, run:


parted /dev/sda
mklabel gpt

Skip over to tl;dr if you are not interested in the details:

When using a GPT partition table, grub2 requires a small dedicated partition at the beginning of the disk. It will use the first 2 MB of this partition to store core.img.
This is explained with a cryptic statement in the manual of grub2:

GRUB2 in BIOS-GPT configuration requires a BIOS Boot Partition to embed its core.img in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table).
For a BIOS-GPT configuration, create a 2 MiB partition using cgdisk or GNU Parted with no filesystem. The location of the partition in the partition table does not matter but it should be within the first 2 TiB region of the disk. It is advisable to put it somewhere in the beginning of the disk before the /boot partition. Set the partition type to “EF02” in cgdisk or set bios_grub on in GNU Parted.

tl;dr:
Create a small partition (a BIOS Boot Partition) at the beginning of the disk and don’t format it. You can use:


unit s
mkpart biosboot 8192 16383
set 1 bios_grub on

There is a very important reason for choosing 16383 as the end of the BIOS Boot Partition.
The next partition will start at sector 16384 and 16384 is a multiple of 4096.

Why is it important to choose a multiple of 8 as the beginning sector of the partition?
Newer hard drives utilize a 4KB sector internally, but they announce a sector size of 512 bytes to the operating system.
It’s very important therefore to make every partition start at a multiple of 4096. This way the 512 bytes block used by the operating system will always be aligned to the 4KB block actually used by disk.
If you fail to do so, whenever the operating disk will need to read 4x 512 byte blocks, it’ll actually read 3x 4KB blocks, thus transferring 3 times more data than it actually needed.
If the 512 byte blocks are aligned to the 4KB blocks, it’d have transferred just those 4KB.

Share

Changing the URL of a mailing list in Mailman

Let’s say that you have just bought a new cool domain and you want to move your mailing-lists from @lists.foo.com to @lists.bar.com.
For newly created mailing-lists, it will be enough to update the value of DEFAULT_URL_HOST in /etc/mailman/mm_cfg.py.
The existing mailing-lists however will keep on using the old domain. Only new mailing-lists are affected by that setting.

In order to fix this, you just need to run:


su -s /bin/sh list
cd /usr/lib/mailman/
bin/withlist -l -r fix_url nameofml1
bin/withlist -l -r fix_url nameofml2
etc.

Repeat for every existing mailing-list. Replace “nameofml” with the name of the mailing list.
This will reset the URL of “nameofml” to the value specified by DEFAULT_URL_HOST in /etc/mailman/mm_cfg.py.

Share

Canon PIXMA MP620 Linux printing and scanning via wireless network on Ubuntu

 

Intro

Got this new All-in-One and it is pretty cool. It’s cheap and it has almost everything I need: wifi connectivity, 1200 dpi resolution scanner, high resolution photo printing, direct copy from scanner.

It also has got some bonuses: you can connect a memory card or a USB Drive key to the printer and read/write to it over LAN/WiFI as a samba share. Pretty neat! I didn’t test it yet though, so no promises (WILL UPDATE SOON).

Unfortunately, using this printer under Linux still requires some tweaking and it’s by no means straightforward, hence this post.

Before you start, do yourself a favour and save considerable time: grab a Windows or MacOSX box and set up the printer for wireless operation. There are other ways to do this under Linux, but they are more complicated.

This howto assumes that you are already able to print a test page from your Windows/MacOSX box over your LAN/WLAN.

Printing from Ubuntu Linux

WARNING: I only tested this under Ubuntu Jaunty.

You should already have CUPS installed. If not, install it now.

Also install the development files and everything needed to compile programs on your machine:

Download the cups-bjnp driver from: http://sourceforge.net/projects/cups-bjnp/

Unpack, configure, compile, install:

Go to Canon Support Australia and download the cnijfilter driver from:

IJ Printer Driver Ver. 2.80 for Linux(debian Common package)

IJ Printer Driver Ver. 2.80 for Linux(debian Package for the MP610 series)

Install them with:

Download the PPD and conf files from my website:

canonmp620-630en.ppd
cifmp610.conf

Copy the ppd and conf file to the proper location:

Restart CUPS:

Turn on the printer and check that you can ping it from your PC.

Open CUPS web interface in your browser: http://127.0.0.1:631

Choose “Add Printer”, give it an alphanumeric name (without spaces) and push “Continue”. On the following page you will be able to choose the “Device”. Pull down the list and select the following entry:

Canon MP620 series ip-address

Click “Continue” and at the next screen select:

from the list. Be careful: do NOT search for Canon PIXMA something, search for Canon MP620-630, without the PIXMA bit!

When asked for a login and password, use whatever you configured CUPS to use: by default login is root and password is your root password.

Thumbs up! We are done :-) You can optionally fine tune some settings in CUPS and then print a test page.

Scanning from Ubuntu Linux

Sane will support the Canon PIXMA MP620 scanner starting from version 1.1 . If your distro doesn’t support this scanner out of the box, like in our case, you’ll have to compile the latest CVS snapshot of sane-backends by yourself.

First install some packages required for compilation:

Download the latest sources via CVS:

Compile:

That’s all!

Thanks to…

Michael Krueger (printing): http://www.michael-krueger.org/2009/01/how-to-use-canon-pixma-mp620-with.html

Nicolas (scanning): http://mp610.blogspot.com/

Share