maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   Format root filesystem to ext3 and restore files (https://talk.maemo.org/showthread.php?t=71511)

scy 2011-03-26 13:30

Format root filesystem to ext3 and restore files
 
These are my steps to transform my internal ext2-root partition into an ext3 filesystem.

Reason: partition seems to be broken, throwing fsck errors here under (2) . fsck.ext2 or ext3 corrected the errors. However, the same errors occured again. In this post I got the hint that this might be a usual ext2 error which ext3 can resolve.

There is also a tune2fs command (tune2fs -j) to add a journal to ext2. I tried this first. As the errors keeped coming back I decided to give a complete reformat of the partition with gparted a try.

Thus, here are the steps I took to format my N810 root partition as ext3 with gparted and restore all files:

Step 0 to 1: task to be performed on the N8x0
Step 2-12: task to be performed on my Ubuntu PC

(0) boot N810 into flash (OS2008 on flash memory)
(1) attach to (linux) system
(2) fdisk -l to check
(3) mount root partition, e.g. mount /dev/sdg2 /mnt/N810ROOT
(4) blkid to check for UUID, to be used later
(5) rdiff-backup /mnt/N810ROOT /backup/N810ROOT
(6) check rdiff-backup error log and session log in rdiff-backup subdirectory (make sure backup is complete)
(6) umount /dev/sdg*
(7) gparted /dev/sdg
(8) With gparted, format root partition (in my case, second partition) to ext3; set label and boot option (not sure if this is necessary) within gparted
(9) set old UUID with tune2fs -U OLDUUID /dev/sdg2 (as I did not want to break my scripts based on UUID)
(10) mount internal MMC again, mount /dev/sdg2 /mnt/N810ROOT
(11) cd /mnt/N810ROOT
(12) rdiff-backup --restore-as-of now /backup/N810ROOT .
or (12) cp -a /backup/N810ROOT/* .
if you have enough space (that then also copies the newly created rdiff-backup subdirectory onto your N8x0 partition)

Checked fsck.ext3 after flash boot:
fsck.ext3 -p -f 61161/110880 files (0.1% non-contigous), 348010/443512 blocks


Other useful commands
fdisk -l /dev/mmcblk0
tune2fs -j /dev/YOURPARTITION TO MODIFY
fsck.ext2 /dev/mmcblk0p2
fsck.ext2 -p -f /dev/mmcblk0p2
fsck.ext3 -p -f /dev/mmcblk0p2


Other useful links:
http://talk.maemo.org/showpost.php?p=161742&postcount=8
http://www.nongnu.org/rdiff-backup/index.html


Here is the link to my problem description - after item (2) - in the diablo turbo thread:
http://talk.maemo.org/showpost.php?p...&postcount=281 and http://talk.maemo.org/showpost.php?p...&postcount=283 suggestion using -p -f flags with fsck


-------------------------------------
Additional information about ext3 in bootmenu.conf:
As my ext3 filesystem kept getting mounted as ext2, I modified the bootmenu.conf to get my ext3 root partition mounted as ext3, as described here.


All times are GMT. The time now is 00:05.

vBulletin® Version 3.8.8