Saturday, September 10, 2011

Fixing File System error on startup

I had a bad crash that damaged my filesystem. And my Ubuntu was not starting.
I needed to fix the file system.

1. Start with CD version of Ubuntu.
2. Open the Terminal.
3. List the all disk devices.
$ sudo fdisk -l
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
...
Device   Boot       Start         End       Block   Id  System
/dev/sda1   *           1      121602   976759808    7  HPFS/NTFS
...
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
...
Device   Boot       Start         End       Block   Id  System
/dev/sdb1               1      121602   976759808    7  HPFS/NTFS
...
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
...
Device   Boot       Start         End       Block   Id  System
/dev/sdc1               1      121602   976759808    7  HPFS/NTFS
...
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
...
Device   Boot       Start         End       Block   Id  System
/dev/sdd1               1      119825   962492416   83  Linux
/dev/sdd2          119826      121602    14267393    5  Extended
/dev/sdd5          120331      121602    10206208   82  Linux swap / Solaris
/dev/sdd6          119826      120331     4061184   82  Linux swap / Solaris

Partition table entries are not in disk order
My Ubuntu is installed on the 4th disk (/dev/sdd), which is damaged.

4. Fix the 4th Disk
$ sudo umount /dev/sdd1      # unmount just in case
$ sudo fsck /dev/sdd1        # fix errors
...                          # hit y(es) several times to allow fixing..

It worked.I was able to start Ubuntu as usual.

1 comment: