Reformat boot partition

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Reformat boot partition

Postby mideam » Mon Feb 03, 2014 1:22 pm

Raspberry Pi Model B

Hi, I am trying to resolve a segmentation fault I get when using pacman.

The fault appeared after running 'pacman -Syu' a few weeks ago.

I ran 'fsck -vcck' for mmcblk0p1 and mmcblk0p2.

for mmcblk0p1 fsck says:

0x25: Dirty bit set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
?

Selecting '1' and running 'fsck -vcck' for mmcblk0p1 again returns the same message.

Is there a way of formatting mmcblk0p1 again while keeping mmcblk0p2 and mmcblk0p3 intact?
mideam
 
Posts: 3
Joined: Mon Feb 03, 2014 1:05 pm

Re: Reformat boot partition

Postby sdjf » Tue Feb 04, 2014 9:17 pm

You may not need to reformat the partition, fsck will not repair errors with that kind of error unless you give it the -a or -r flag.

I generally call fsck.vfat directly, you could try that first. It is annoying that it ignores answers to the question about making repairs if you have not given those flags when you call it.

I am not sure about the other flags you are using, double check the man page for fsck.vfat and use that directly to just check the fat partition.

I also am not sure that, if that fails, you need to repartition just partition 1, since it is the file system that is at issue, I would think you could just remove the old file system within partition 1 and make a new one, copying good boot files back to it.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: Reformat boot partition

Postby mideam » Fri Feb 07, 2014 2:16 pm

Thanks for the advise on trying to resolve a pacman segmentation fault.

I ran fsck as per instructed in the previous post, and the issue is still present.

I backed up both mmcblk0p1 and mmcblk0p2, formatted them with mkfs.vfat and mkfs.ext4 respectively, then copied the files back.

The issue is still present. Any further ideas?
mideam
 
Posts: 3
Joined: Mon Feb 03, 2014 1:05 pm

Re: Reformat boot partition

Postby moonman » Fri Feb 07, 2014 11:18 pm

Is complete reinstall an option? it maybe less time consuming then figuring out what the problem is in this situation. If not try running strace to see if it gives you any hints
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Reformat boot partition

Postby sdjf » Sat Feb 08, 2014 12:46 am

Moonman is right, but if you are bugged and want to figure out what is going on, then since partition 1 was dirty, I would NOT use the files from that first card on the reformatted partition, I would use files you knew for sure had not been corrupted.

Also, maybe the card itself is bad, try running badblocks on it, but read the man page for that, it does not provide very helpful output unless you ask properly. I do have a section about badblocks on my page about problems with expansion card integrity, you could also look at that I suppose.

http://sdjf.esmartdesign.com/cards.html#badblocks

Page is focussed on media attached to a Zaurus PDA, but the basic ideas are the same, and I am slowly adding stuff to make it more relevant to the Pi as well.

Output from badblocks command can be used to show a card is defective and possibly exchange for a new one if it is under warrantee.

But make sure you reboot the Pi first, otherwise it can give misleading output, claiming the card is bad when the Pi's memory is just overchallenged. I have had that happen.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: Reformat boot partition

Postby moonman » Sat Feb 08, 2014 12:53 am

sd cards have its own mechanism to mark bad blocks and do wear leveling. If you start seeing bad blocks on an sd card at user level the card is basically garbage already
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Reformat boot partition

Postby mideam » Sun Feb 09, 2014 11:46 pm

Thanks for the info.

I seem to remember a similar thing happening before so if it is fixable it may be preferable to configuring everything again.

Searching for a word in nano is causing a similar error:

    Segmentation fault (core dumped)

The last 8 lines of 'strace pacman -Ss exim' were:

    read(3, "\277\223\265\17L\370\17\2637\373\377_\341\376\375\361\371\37\202\275\331\377q\10\377\310\377x\27{[\377"..., 8192) = 7251
    brk(0x1c70000) = 0x1c70000
    read(3, "", 8192) = 0
    close(3) = 0
    --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0xb68b3160} ---
    write(2, "\nerror: segmentation fault\nPleas"..., 88) = 88
    exit_group(11) = ?
    +++ exited with 11 +++[/list]

I remember badblocks returning ok. I should run it again with '-v' incase I ran it quietly.

I hastily downloaded the latest image and copied new files to mmcblk0p1. Now at boot it stops booting shortly after outputting:

    PANIC: VFS: Unable to mount root fs on unknown-block(179,5)

Looks like I'm going to have to install the system from new.

Thanks for your inputs. If anyone draws anything from the strace output, would be interesting to hear.
mideam
 
Posts: 3
Joined: Mon Feb 03, 2014 1:05 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 4 guests