Reply
Thread Tools
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#31
I think sulu meant what numbers do you get.
__________________
Русский военный корабль, иди нахуй!
 

The Following User Says Thank You to pichlo For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#32
Originally Posted by pichlo View Post
I think sulu meant what numbers do you get.
It should look like this (as reference from an in good condition device):
Code:
~ $ root

:~# fdisk -l

Disk /dev/mmcblk1: 15.9 GB, 15931539456 bytes
255 heads, 63 sectors/track, 1936 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk1p1               1        1937    15554048   c Win95 FAT32 (LBA)

Disk /dev/mmcblk0: 32.0 GB, 32015122432 bytes
4 heads, 16 sectors/track, 977024 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1               2      884865    28315648   c Win95 FAT32 (LBA)
/dev/mmcblk0p2          884866      950401     2097152  83 Linux
/dev/mmcblk0p3          950402      974977      786432  82 Linux swap
:~#
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 3 Users Say Thank You to peterleinchen For This Useful Post:
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#33
Thanks, Peter. I was hoping you would paste yours as mine is currently indisposed

@sirvival, FYI, /dev/mmcblk1 may be looking different or missing completely. That's normal, it refers to your SD card. If you don't have one, it won't be there. But I'm sure you knew that already.
__________________
Русский военный корабль, иди нахуй!
 

The Following 2 Users Say Thank You to pichlo For This Useful Post:
Posts: 46 | Thanked: 40 times | Joined on Jan 2014 @ Hamburg
#34
hi,
I tried out marble so sulus command gives me an awful lot of files.
I tried his command before I started marble, just didn't save the result but it looked fine (apart from the size of the partition)

Hmm:
Nokia-N900:~# sfdisk -l

Disk /dev/mmcblk1: 121008 cylinders, 4 heads, 16 sectors/track
Warning: The partition table looks like it was made
for C/H/S=*/49/48 (instead of 121008/4/16).
For this listing I'll assume that geometry.
Units = cylinders of 1204224 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/mmcblk1p1 3+ 3292- 3290- 3868160 b W95 FAT32
start: (c,h,s) expected (3,23,33) found (1,2,3)
end: (c,h,s) expected (1023,48,48) found (960,48,48)
/dev/mmcblk1p2 0 - 0 0 0 Empty
/dev/mmcblk1p3 0 - 0 0 0 Empty
/dev/mmcblk1p4 0 - 0 0 0 Empty

Disk /dev/mmcblk0: 977024 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 1 622720 622720 19927040 c W95 FAT32 (LBA)
/dev/mmcblk0p2 884865 950400 65536 2097152 83 Linux
/dev/mmcblk0p3 950401 974976 24576 786432 82 Linux swap / Solaris
/dev/mmcblk0p4 622721 884864 262144 8388608 76 Unknown
Looks strange
 

The Following 2 Users Say Thank You to sirvival For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#35
sfdisk is similar tool as fdisk but just similar so output is different.
Here is sfdisk - l from my device:
Code:
:~# sfdisk -l

Disk /dev/mmcblk1: 486192 cylinders, 4 heads, 16 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/255/63 (instead of 486192/4/16).
For this listing I'll assume that geometry.
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/mmcblk1p1          0+   1936-   1937-  15554048    c  W95 FAT32 (LBA)
/dev/mmcblk1p2          0       -       0          0    0  Empty
/dev/mmcblk1p3          0       -       0          0    0  Empty
/dev/mmcblk1p4          0       -       0          0    0  Empty

Disk /dev/mmcblk0: 977024 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          1  884864  884864   28315648    c  W95 FAT32 (LBA)
/dev/mmcblk0p2     884865  950400   65536    2097152   83  Linux
/dev/mmcblk0p3     950401  974976   24576     786432   82  Linux swap / Solaris
/dev/mmcblk0p4          0       -       0          0    0  Empty
co
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 4 Users Say Thank You to peterleinchen For This Useful Post:
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#36
OK, so sirvival's mmcblk0p1 was split in two. I could not dare to guess how it happened but it is fixable easily, even with just the tools available on the device. You need to delete mmcblk0p1 and mmcblk0p4 and recreate mmcblk0p1. If you run fdisk without parameters, it starts in an interactive mode, allowing you to give commands. But this is potentially a very dangerous area and I would really not dare to advice you further without referring to my own device. Please bear with me while I get it ready.
__________________
Русский военный корабль, иди нахуй!
 

The Following 3 Users Say Thank You to pichlo For This Useful Post:
Posts: 915 | Thanked: 3,209 times | Joined on Jan 2011 @ Germany
#37
Originally Posted by sirvival View Post
Code:
Disk /dev/mmcblk0: 977024 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          1  622720  622720   19927040    c  W95 FAT32 (LBA)
/dev/mmcblk0p2     884865  950400   65536    2097152   83  Linux
/dev/mmcblk0p3     950401  974976   24576     786432   82  Linux swap / Solaris
/dev/mmcblk0p4     622721  884864  262144    8388608   76  Unknown
Looks strange
Indeed!
Where does your mmcblk0p4 come from, or rather, why doesn't it have a zero size like in peterleinchen's output?
But in the end that's just odd, it's not actually a problem. It just happens to cost you 8GB of free space.
 

The Following 3 Users Say Thank You to sulu For This Useful Post:
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#38
I thought about that and figured that perhaps I should try second-guessing how it happened after all. The partition table is too neat to put it down to a pure chance caused by a random corruption.

As far as I understand, all you did was format your FAT partition from File Manager. Maybe, just maybe, the format did hit a bad sector and, instead of marking it and moving on, it cut the partition at that point and created a new one from that point to where the partition used to end.

The easiest way IMO would be to recreate mmcblk0p1 again and repeat the exercise of formatting it in File Manager. It would be interesting if we ended up in the same situation.

So... here we go.

First off, I was wrong, it is not fdisk, it is parted you need.
What do you mean you don't have parted? Install it, then!

Start with:
Code:
root
parted /dev/mmcblk0
This will start parted in an interactive mode, with "(parted)" as a prompt. You can type "help" or just "h" at any point to print help.

Let's start easily. Note that my commands are in blue, everything else is parted's prompts/responses. Also note that my partition boundaries differ a bit from peterleinchen's as I edited them myself a few years ago using exactly this method:
Code:
(parted) print
print
Model: MMC MMC32G (sd/mmc)
Disk /dev/mmcblk0: 32.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system     Flags
 1      32.8kB  29.0GB  29.0GB  primary  fat32           lba
 2      29.0GB  31.2GB  2215MB  primary  ext3
 3      31.2GB  32.0GB  805MB   primary  linux-swap(v1)

(parted)
Now the risky part. Seriously risky, so proceed with extreme caution. Or not at all if you do not feel confident.
First, exit parted ("quit"), unmount /dev/mmcblk0p1 and start parted again as above.
Then...
Code:
(parted) rm 4
(parted) rm 1
(parted) mkpart
This should present a series of interactive prompts about the new partition. You can skip all of that by typing all the answer right away in the mkpart line, but interactive is easier:
Code:
Partition type?  primary/extended? p
File system type?  [ext2]? fat32
Start? 0
End? 29GB
If it warns you about partitions not matching cylinder boundaries, you can choose to ignore that or cancel and start again with different values for Start and End.

Once again, if you have any doubt, do not proceed!. If you make a mistake, you risk a loss of important data and may need to reflash your device. I have done it a few years ago and only repeated the steps today on a disposable SD card to make sure they work. And I had a big PC to check the result with. Please exercise extreme caution when doing it on a live system far out in the field.
__________________
Русский военный корабль, иди нахуй!
 

The Following 5 Users Say Thank You to pichlo For This Useful Post:
Posts: 46 | Thanked: 40 times | Joined on Jan 2014 @ Hamburg
#39
wow thanks for all the work!!!

My guess is that the partition got split at the bad sector too.
The third number of number 4 looks really close to the one fchk kept complaining about.

I will first let it run this way for a while to check if more corruption kreeps up. And I will wait till I get home and have a big screen to go through all the steps before I start.
And I want to backup everything just in case I need to reflash.
 

The Following 2 Users Say Thank You to sirvival For This Useful Post:
Posts: 46 | Thanked: 40 times | Joined on Jan 2014 @ Hamburg
#40
update (since last post):
had to do the VACCUM command today because one conversation was stuck
And fsck found some things to correct (something with end of cluster)
 

The Following User Says Thank You to sirvival For This Useful Post:
Reply

Tags
corrupted, mydocuments

Thread Tools

 
Forum Jump


All times are GMT. The time now is 18:56.