Skip to main content

Recovering broken ubuntu partition

Recently, one of my client's computer (Ubuntu 10.10) refused to boot. Instead of booting the operating system it fell down to grub rescue prompt. This indicated that grub could not find its configuration file and it meant the partition table was corrupted :(.

Fortunately, I finally succeeded repairing the system. What I learned from this experience is that ext file system is such a wonderful system which enabling partition recovery.




These are steps I took, unfortunately there were no screenshots (forgot to take):


  1. Boot with Ubuntu live CD. The booting seemed took time forever because it tried to access the broken partition, but eventually the live session was up.
  2. Open terminal, became root and checked whether the partition was still there.

    #fdisk -l


    Fortunately, fdisk still list the hard disk partition.
  3. Try to repair with e2fsck.

    #e2fsck -C 0 -v /dev/sda1

    -C 0: means the completion information will be written in file descriptor 0 which is our console.
    -v: verbose

    Unfortunately, this step failed.
  4. After some googling research, I knew that ext file system save its meta data structure in what is called "Superblock" and fortunately ext file system have several Superblocks, so if one superblock is failed we can recover from the other superblock. Now, my problem was find a way to query the superblocks. A way to query the superblock is with dumpe2fs

    # dumpe2fs /dev/sda1 | grep -i superblock


    Unfortunately, this step also failed. dumpe2fs could not read partition /dev/sda1
  5. Next step, I tried testdisk. You can read how to use testdisk here: http://www.howtogeek.com/howto/15761/recover-data-like-a-forensics-expert-using-an-ubuntu-live-cd/. Unfortunately, when testdisk "Analyze" function also failed to recover the partition. Its automatic search algorithm report that what it found were ntfs partitions which obviously wrong :)
  6. I then explored testdisk Advanced menu (File system utils). I found there was a facility to locate the superblock backups. I run this menu and fortunately it found all the superblock backups. Testdisk wrote all the findings in testdisk.log file so we didn't have to take the note manually.
  7. Quit running e2fsck again but this time with -b (use alternative superblock) option.

    #e2fsck -b nnn -C 0 -v -p -y /dev/sda1

    replace nnn with one of the superblock backup found by testdisk in the above step. Look in testdisk.log

    This time e2fsck succeeded repairing the partition. I rebooted the computer, took out the live cd and the computer came to life again.

Comments

Popular posts from this blog

Program timbangan elektronik, sebuah program Windows yang dijalankan di Linux.

Kemarin, mumpung hari libur aku setup program timbangan digital baru di kantor. Program yang lama merupakan program DOS yang aku tulis dengan menggunakan Clipper, program ini berjalan dengan baik di linux dengan bantuan dosemu. Program baru merupakan program Windows. Salah satu improvement dalam program ini adalah support untuk beberapa jenis indikator. Program diinstall di linux dengan wine versi 1.1.20. Beberapa catatan dalam instalasi program ini di wine: Pencetakan slip bukti timbangan dan laporan-2 menggunakan printer Dot Matrix. Apabila pencetakan dilakukan lewat printer driver, pencetakan dengan printer dot matrix akan menjadi sangat lambat plus hasil buruk plus boros pita... :) Oleh karena itu, program ini melakukan pencetakan langsung melalui printer port lpt1. Di windows, hal ini tidak menjadi suatu permasalahan, di linux dengan wine, maka lpt1 akan dimap ke /dev/lp0. Masalahnya, owner dari device ini adalah root dan group lp. Secara default user-user di Ubuntu (..nggak tahu...

Install Sketchup 2017 64 bits on Linux Ubuntu 16.04 64 bits

Install Sketchup 2017 64 bits on Linux Ubuntu 16.04 64 bits: 1.Enable 32 bit architecture: $sudo dpkg --add-architecture i386  2. Set wine PPA $sudo add-apt-repository ppa:wine/wine-builds Update repository $sudo apt-get update 3. Install wine newest staging branch version $sudo apt-get install --install-recommends winehq-staging 4. Ensure we get a 64bits wine, edit file ~/.profile and locate for text: export WINEARCH= If the value is win64 you are good, if the value is win32 change it to win64. Save the file. Ensure the environment variable also set to win64 by typing command: $export WINEARCH=win64 5. Download winetricks: $wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks    Don't forget to set the attribute so it is executable $chmod +x winetricks 6. Run winetricks $./winetricks Inside winetricks: Choose Select the default wineprefix, click OK Choose Install a Windows DLL or component, click O...

Install Windows Printer Fuji Xerox DocuPrint P205 b di Ubuntu

Kemarin ada yang baik hati memberikan aku printer laser Fuji Xerox type DocPrint P205b. Masalahnya, printing system di Ubuntu (CUPS) tidak ada driver untuk printer ini. Situs Fuji Xerox pun ( http://www.fujixeroxprinters.com.au/en/Downloads.aspx?product=9933 ) tidak menyediakan printer driver untuk linux, karena ternyata printer ini adalah GDI printer. GDI printer biasanya merupakan printer murah meriah, karena dia tidak mempunyai 'otak' untuk memproses image (rasterize). Pemrosesan image diserahkan ke operating system. Oleh karena itu printer-printer semacam ini biasanya hanya bisa dipakai di Windows saja. Namun, dunia linux benar-benar menakjubkan – hampir tidak ada yang mustahil di linux. Setelah searching di internet, akhirnya aku menemukan sebuah situs yang menyediakan driver untuk printer ini, namun untuk menginstallnya tidak sekedar mengcopy file drivernya (.ppd) saja. Silahkan cek http://foo2hbpl.rkkda.com/ . Di bawah ini adalah langkah-langkah untuk mengi...