Posts

Showing posts from August, 2010

LVM metadata corruption

I had the biggest PC related scare a couple of days ago. After I had two disks in my RAID5 fail in a very short amount of time and only pure luck saved my data I moved to RAID6 and I felt safer. That was, until two days ago I ran: # pvs -v pvs Scanning for physical volume names pvs Incorrect metadata area header checksum pvs Incorrect metadata area header checksum pvs WARNING: Volume Group vg0 is not consistent pvs Incorrect metadata area header checksum pvs Incorrect metadata area header checksum pvs PV VG Fmt Attr PSize PFree DevSize PV UUID pvs /dev/md2 vg0 lvm2 a- 1.80T 922.19G 1.80T Y9naEo-OKG6-0ZyX-qmZX-u3JP-uCPg-cE1hVX Ooops. Not looking good. # vgs -v vgs Finding all volume groups vgs Incorrect metadata area header checksum vgs Finding volume group "vg0" vgs Incorrect metadata area header checksum vgs Incorrect metadata area header checksum vgs VG Attr Ext #PV #LV #SN VSize VFree VG UUID vgs vg0 wz--n- 4.00M 1 15

Updating u-boot on SheevaPlug

Tools required openocd tftp-hpa cross compiler Cross-compiler: cd customrepo mkdir cross-armv5tel-softfloat-linux-gnueabi ln -s ../gentoo/sys-devel/{gcc,binutils} cross-armv5tel-softfloat-linux-gnueabi sudo cave resolve cross-armv5tel-softfloat-linux-gnueabi/gcc Updating u-boot: There are several repositories, but the official one is this one: http://git.denx.de/u-boot.git . The maintainer of the official one actually recommends using the repos for each architecture, in the case of the SheevaPlug that would the Marvell repo: git://git.denx.de/u-boot-marvell.git . git init git remote add marvell git://git.denx.de/u-boot-marvell.git git fetch marvell git checkout -b testing marvell/testing cat <<EOF >GNUmakefile CROSS_COMPILE ?= armv5tel-softfloat-linux-gnueabi- include Makefile EOF make sheevaplug_config make u-boot.kwb Now you can try the new u-boot on your plug: openocd -f /usr/share/openocd/scripts/board/sheevaplug.cfg In another terminal (or screen) telnet localhost 4444 &g

Easily cross-compiling a kernel

To avoid having to export the CROSS_COMPILE variable every time you recompile your cross-compile kernel, a suggestion I found is to define the variable in the Makefile itself. Like so: ARCH = arm CROSS_COMPILE = armv5tel-softfloat-linux-gnueabi- This is nice, but then I get conflicts when I pull in the new kernel updates with git. Or even worse, my kernel version gets tagged as "-dirty" to reflect the modified source tree, as opposed to a pristine git checkout. So, a workaround is to put these in a GNUmakefile (checked first by GNU make, and not managed in the kernel repo). $ cat <<EOF >GNUmakefile ARCH = arm CROSS_COMPILE = armv5tel-softfloat-linux-gnueabi- include Makefile EOF