maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   eMMC got corrupted (https://talk.maemo.org/showthread.php?t=86239)

MamoriNoTenshi 2012-09-01 15:09

Re: eMMC got corrupted
 
It's 7561216

michaaa62 2012-09-01 18:19

Re: eMMC got corrupted
 
The default setup for Maemo is a 2GB optfs partition for installable applications, a 768MB swap partition and the rest 27GB MyDocs data partition. There is not much sense in changing the swap partition size.

Do you think you need more space than the default for optfs???

MamoriNoTenshi 2012-09-01 20:08

Re: eMMC got corrupted
 
My dad is an old guy like... He can't even take a picture lol. Let's do it man!

michaaa62 2012-09-01 21:28

Re: eMMC got corrupted
 
Let' try! I split the code because of the second command which spans for 5 lines! Each box is just one command.
First: Create and write the partition table to the device:
Code:

sudo gainroot
Code:

echo "unit: sectors
 > /dev/mmcblk1p1 : start=      64, size= 9355200, Id=0
 > /dev/mmcblk1p2 : start=  9355264, size= 4194304, Id=0
 > /dev/mmcblk1p3 : start= 13549568, size= 1572864, Id=0
 > /dev/mmcblk1p4 : start=        0, size=      0, Id= 0" > table

Code:

sfdisk --no-reread /dev/mmcblk1 < table
Then reboot.

Second: Activate the partitions and apply the file systems (each line one command):
Code:

sudo gainroot
sfdisk -c /dev/mmcblk1 1 c
mkfs.vfat -F32 -n MyDocs /dev/mmcblk1p1
sfdisk -c /dev/mmcblk1 2 83
mkfs.ext3 -L optfs /dev/mmcblk1p2
sfdisk -c /dev/mmcblk1 3 82
mkswap -L swap /dev/mmcblk1p3

Now copy the content of /home and /opt to the new partition
Code:

mount -t ext3 /dev/mmcblk1p2 /mnt
cp -a /home/* /mnt
mkdir /mnt/opt/
cp -a /opt/* /mnt/opt/

Third: Change some system files to reflect the new setup:
Code:

apt-get install nano
nano /usr/lib/genfstab.awk

Comment out the last 10 lines
Quote:

start == 1 && $6 == 83 && !__home {
printf "%s /home ext3 %s 0 0\n", $1, home_opts
printf "/home/opt /opt none bind\n"
__home++
}

start == 1 && $6 == "c" && !__fat {
printf "%s /home/user/MyDocs vfat %s 0 0\n", $1, fat_opts
__fat++
}
This will make sure there will not be an autogenerated fstab anymore.
Now edit /etc/event.d/rcS-late
Code:

nano /etc/event.d/rcS-late
Find the line
Quote:

-f /usr/lib/genfstab.awk > $tmp_fstab
and add this below it
Code:

echo "/dev/mmcblk1p2 /home ext3 rw,noatime,errors=continue,commit=1,data=writeback 0 0" >> $tmp_fstab
echo "/home/opt /opt none bind" >> $tmp_fstab
echo "/media/mmc1 /home/user/MyDocs none bind" >> $tmp_fstab
echo "/dev/mmcblk1p1 /home/user/MyDocs vfat noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir 0 0" >> $tmp_fstab

This is the basic setup. The last line of code might work, but might as well be overwritten by some other maemo settings, it is experimental, so don't use the MyDocs folder without further testing, including a couple of reboots to be sure.

Hope it helps!

MamoriNoTenshi 2012-09-01 23:29

Re: eMMC got corrupted
 
Dude I'm lost in the nano part. I don't know how to use that thing. I don't even know how to save the file, and how do i type those lines? In the very beggining of the second line or uh... XD. And did everything you said and terminal gave.me good outputs (or at least that's what I thnk lol) but the phone is the same :(

michaaa62 2012-09-02 07:17

Re: eMMC got corrupted
 
1 Attachment(s)
Use <CTRL +x> to leave nano, which will ask you to save the file with the same name, verify the name and answer 'Y', large 'y'. You better copy and paste the comands and file contents not to mess with typos. I attach it all in a textfile for easier copy and paste.


All times are GMT. The time now is 19:20.

vBulletin® Version 3.8.8