maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N810 (https://talk.maemo.org/forumdisplay.php?f=28)
-   -   Internal Memory Card: Can you 'cat /proc/partitions' for me? (https://talk.maemo.org/showthread.php?t=14416)

janozaurus 2008-01-05 00:47

Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
I'm worried that something with my built-in memory card is wrong. Can someone who owns a N810 do me a favour:

Open a Terminal on the tablet and type
Code:

cat /proc/partitions
On my device mmcblk0p1 is bigger than mmcblk0, which is strange.

Optionally, if you're on a linux computer, attach the tablet via USB and do the same on the host computer. If you're as confused as I am, read dmesg.

Thank you.

brendan 2008-01-05 01:00

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
n800

major minor #blocks name

31 0 128 mtdblock0
31 1 384 mtdblock1
31 2 2048 mtdblock2
31 3 2048 mtdblock3
31 4 257536 mtdblock4
254 0 3979776 mmcblk0
254 1 3975680 mmcblk0p1
254 8 7902720 mmcblk1
254 9 7902712 mmcblk1p1

lma 2008-01-05 03:41

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
N810:

Code:

major minor  #blocks  name

  31    0        128 mtdblock0
  31    1        384 mtdblock1
  31    2      2048 mtdblock2
  31    3      2048 mtdblock3
  31    4    257536 mtdblock4
 254    0    1966080 mmcblk0
 254    1    1966072 mmcblk0p1
 254    8    7977472 mmcblk1
 254    9    7973376 mmcblk1p1

The internal memory "card" is mmcblk0 and contains only one partition (mmcblk0p1) which is slightly smaller than the whole device here. In more detail:
Code:

Nokia-N810-50-2:~# sfdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 61440 cylinders, 4 heads, 16 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/mmcblk0p1          0+  61439  61440-  1966072    b  W95 FAT32
/dev/mmcblk0p2          0      -      0          0    0  Empty
/dev/mmcblk0p3          0      -      0          0    0  Empty
/dev/mmcblk0p4          0      -      0          0    0  Empty

You should be able to fix it by unmounting it, running sfdisk on it to delete and recreate the first partition and finally using mkfs.vfat -F 32 to "format" the partition as FAT32.

Moonshine 2008-01-05 03:54

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
@Ima - Looks like you have an 8gb card in the external slot. Can I ask what you are using? Sandisk 8gb micro with a mini converter?

lma 2008-01-05 11:34

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Yes, with the adapter reported working in https://bugs.maemo.org/show_bug.cgi?id=2672

janozaurus 2008-01-05 18:10

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Quote:

Originally Posted by lma (Post 121145)
You should be able to fix it by unmounting it, running sfdisk on it to delete and recreate the first partition and finally using mkfs.vfat -F 32 to "format" the partition as FAT32.

EDIT
This can be done from the GUI as well. JFTR:
  1. Open File Manager
  2. Click Memory Card
  3. Select Format Memory Card from Menu
(My device speaks German. Translations guessed)
And it worked.
/EDIT

But..., does this mean Nokia sold me (and others) an internal card with a broken partition table? Don't they ever test anything? (I read people lost data on USB sticks in similar situations. IMHO, any sane system should refuse to mount this, but, of course, no one asked for MHO.)

fanoush 2008-02-14 13:28

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Quote:

Originally Posted by janozaurus (Post 121433)
But..., does this mean Nokia sold me (and others) an internal card with a broken partition table?

Yes, looks like they did :-) Same error here with two brand new N810 devices, reported as http://bugs.maemo.org/show_bug.cgi?id=2940

kilroy155 2008-02-14 21:52

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
If I am understanding this correctlt,it appears I have the same problem:

Code:

~ $ cat /proc/partitions
major minor #blocks name

31  0    128 mtdblock0
31  1    384 mtdblock1
31  2    2048 mtdblock2
31  3    2048 mtdblock3
31  4  257536 mtdblock4
254 0 3932160 mmcblk0
254 1 3928064 mmcblk0p1
254 8 1966080 mmcblk1
254 9 2007032 mmcblk1p1
~ $

I have a 4GB removable card, so I assume that in my case the mmcblk1 is the internal card. The p1 partition appears to be larger than the card size.

I haven't noticed any problems yet, but would like to resolve this before I do. I am a newbie to this so what is the best way to solve this and lose as little as possible. Is there a way to backup or copy everything that is on the internal memory card before reformatting it, and then to copy/restore it back? It is my understanding that the internal backup utility doesn't backup everything.

Thanks

fanoush 2008-02-15 08:49

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Quote:

Originally Posted by kilroy155 (Post 142589)
Is there a way to backup or copy everything that is on the internal memory card before reformatting it, and then to copy/restore it back?

Yes, open X terminal and run
Code:

cp -r /media/mmc2 /media/mmc1/
This should create folder named mmc2 or your external card with everything copied from internal card. To be sure, check it with
Code:

find /media/mmc1/mmc2
You should see all file names. Also output of
Code:

du -sk /media/mmc2
du -sk /media/mmc1/mmc2

should give similar number. Also after copy, check kernel log via running 'dmesg' to see if there are any i/o errors, this may be sign of data corruption in some files you copied.

After formatting copy it back via
Code:

cp -r /media/mmc1/mmc2/* /media/mmc2/
.

kilroy155 2008-02-16 06:29

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Thanks, thats what I needed. I followed those steps and the partition size looks good now.

I appear to have all the files back, but there were about seven I/O errors reported by 'dmesg' so perhaps something is corrupted. I was initially unable to format the card until I removed the virtual memory space I had allocated to it. That was still activated when I performed the copy so maybe that had something to do with the I/O errors (?)

macpeep 2008-02-16 22:46

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
What should the size of the partition be? I had this issue too and after reformatting /proc/partitions is saying 1966080 mmcblk0 and 1966072 mmcblk0p1 but df says 1962236 for /media/mmc2. Is the small differences between these to be expected? Do others see the same figures?

kilroy155 2008-02-17 04:09

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
I'm a newbie so can't say what is correct, but after formatting my card all my numbers are exactly the same as yours.

dan 2008-09-29 15:40

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Fanoush,
The above advise works well for copying files from a particular card.
Can you advise on how to make a complete copy of mmc2 so that it includes not only files but the entire dual boot setup, preferences, kde, menu, apps, etc.
I have tried several methods mentioned in other threads but none seem to copy everything. I'm trying to make a backup card in case I trash my current one when testing new scripts. It would be ideal if I can just set the backup card in mmc1 and make a mirror copy from mmc2. Any ideas or methods you have come across that work in duplicating the entire mmc2 dual boot structure with all the apps, preferences, menus, etc.
TIA

Benson 2008-09-29 16:00

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
The dual boot setup is not on the card, so that won't work; you always have to modify the initfs if it gets wiped. Other than that, dding the whole thing to a file, and thence to the backup card, is the simplest way, or alternatively, dd from one card straight onto the other (if you've got an N800, this can be done on the device booted into flash; otherwise, using a PC and SD -> HDD ->SD might be better).

dan 2008-09-29 23:28

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Benson
Thanks. Did not know that dual boot setup is not on the card.
First what is dding?
I've never seen that term and google brings up wedding. :)
I would prefer dd? on my N800 to dding? card to card.
I booted to flash. My next guess is go into root and type what?
Once I do this I will be very happy.
TIA

Benson 2008-09-29 23:50

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
dding = using dd

If you have two SDs of identical capacity,
Code:

dd if=/dev/mmcblk0 of=/dev/mmcblk1
Or the other way around, if your source is the external slot. And maybe add bs=32768 for faster transfers...

dan 2008-09-30 00:28

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Benson thanks.
How long should it take?
Also do I add the ' bs=32768 ' after mmcblk1?

Edit: Found online that you add bs=32768 after mmcblk1.
Edit: Worked beautifully by adding the bs=32768. Took about 4 hours.

fanoush 2008-09-30 10:58

Re: Internal Memory Card: Can you 'cat /proc/partitions' for me?
 
Quote:

Originally Posted by Benson (Post 228636)
If you have two SDs of identical capacity

Where identical really means down to last byte so it should better be exactly same manufacturer/brand, not just two random 8 gig cards. Output of cat /proc/partitions tells exact size.

Quote:

Originally Posted by Benson (Post 228636)
Code:

dd if=/dev/mmcblk0 of=/dev/mmcblk1

if your second card is larger then you can copy to file (so you can have other files there too)
Code:

dd if=/dev/mmcblk0 of=/media/mmc1/mmcblk0backup.bin
or you can pipe it through gzip to make it smaller (may take longer)

Code:

dd if=/dev/mmcblk0 | gzip > /media/mmc1/mmcblk0backup.bin.gz
This is all easy but also very wasteful since you are backing up unused space too. More sophisticated way is to backup partition table (via dd or sfdisk) and then backup just files from each partition (via tar) and later restore partition table, re-create filesystems and then restore all files.

Best would be to port partimage or similar tool to maemo.


All times are GMT. The time now is 02:38.

vBulletin® Version 3.8.8