Thursday, May 06, 2010

Ubuntu 10.04 lucid server

Just right after the release of ubuntu 10.04 lucid, I installed it in my computer.
This time, it is a server, not a desktop version.

It was exactly what I expected!

no graphics, no eye-candy stuff.

very simple and very fast.

But I got a problem after installing it.

Until the version 9.10, ubuntu used ext3 as default file system.
But it was changed into ext4 file system in 10.04.
Without any prior information of new version I put the server CD in my cd-rom.
after the clean install, I mounted all my old partions.
I seems working perfectly.

In the next I found that the server was down and tried to reboot it.
it stucked in fsck while boot up.

I tried and tried with no success.

After failing hundred of tries, I started google.
The error message was "ureadahead-other main process terminiated..".
It was told that this message is involved in data cache or file system read.
Then I checked the release note of ubuntu 10.04 lucid.

I found that default file system was changed to ext4.

consequently I google to know how to recover and convert the filesystem.

The asnswer i fouind was the following commands.

root@server# fsck.ext3 -pf /dev/sdd2
/dev/sdd2: 238/9158656 files (39.5% non-contiguous), 19796871/36634224 blocks
root@server# tune2fs -O extents,uninit_bg,dir_index /dev/sdd2
tune2fs 1.41.11 (14-Mar-2010)

Please run e2fsck on the filesystem.
root@server# tune2fs -O extents,uninit_bg,dir_index /dev/sdd2
tune2fs 1.41.11 (14-Mar-2010)

root@server# fsck /dev/sdd2
...
Group descriptor 1113 checksum is invalid. FIXED.
Group descriptor 1114 checksum is invalid. FIXED.
Group descriptor 1115 checksum is invalid. FIXED.
Group descriptor 1116 checksum is invalid. FIXED.
Group descriptor 1117 checksum is invalid. FIXED.
/dev/sdd2 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdd2: 238/9158656 files (39.5% non-contiguous), 19796871/36634224 blocks

Actually above /dev/sdd2 partition was lost by wrong mounting option in /etc/fstab.
While its file system is ext3, I write its filesystem as ext4 in /etc/fstab.
This must be my biggest mistake and carelessness.
I believe this small mistake makes whole system fault.

After the failure, /dev/sdd2 partion was lost.
fdisk command shows that sdd2 is not partitioned.

to recover the filesystem, I used parted command.

root@server# parted /dev/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit
Unit? [compact]? cyl
(parted)print
Model: ATA Hitachi HDT72502 (scsi)
Disk /dev/sdd: 30401cyl
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 30401,255,63. Each cylinder is 8225kB.
Partition Table: msdos

Number Start End Size Type File system Flags
1 0cyl 12157cyl 12157cyl primary ext4

(parted) rescue 12158 30401

With this three command, I recovered the ext3 partition again!

and next, I converted it into ext4 then I use it flawlessly.

No comments: