Friday, April 14, 2017

Detect CPU bug on x86

Something I always forgot:

$ sudo apt-get install mcelog

Then simply set:

$ grep error /etc/mcelog/mcelog.conf
syslog-error = yes

Thursday, April 9, 2015

Dell Laptop Fan Control And Get CPU Temperature

http://www.cyberciti.biz/faq/controlling-dell-fan-speeds-temperature-on-ubuntu-debian-linux/

$ i8kctl fan 1 1

Wednesday, April 8, 2015

Session Description Protocol on FreeBox V5

Currently here is what I have on FreeBox v5 (firmware 1.5.20):

$ avprobe "rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=996&flavour=hd"
[...]
Input #0, rtsp, from 'rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=996&flavour=hd': Metadata: title : unknown comment : unknown Duration: N/A, start: 13461.359467, bitrate: N/A Stream #0.0: Data: [0][0][0][0] / 0x0000 Stream #0.1: Data: [0][0][0][0] / 0x0000 Stream #0.2: Audio: aac, 48000 Hz, stereo, s16 Stream #0.3: Data: [0][0][0][0] / 0x0000 Stream #0.4: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 26.40 fps, 25 tbr, 90k tbn, 50 tbc
[...]

This is part of the Real Time Streaming Protocol, during a `DESCRIBE` (https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol#Protocol_directives) an application/sdp message is sent containing:


v=0
o=leCDN 1428411111 1234565108 IN IP4 kapouet.proxad.net
s=unknown
i=unknown
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 33
a=control:rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=100008

It would have been nicer to include the actual name of the show to store it as title in an MP4 container !

Friday, February 6, 2015

syscfg on debian

Steps:



wget ftp://ftp.dell.com/sysman/dtk_3.1.1_165_Linux.iso
mkdir /tmp/loop
sudo mount -o loop dtk_3.1.1_165_Linux.iso /tmp/loop
mkdir /tmp/bla
cd /tmp/bla
sudo apt-get install rpm2cpio
rpm2cpio /tmp/loop/tools/dell-toolkit.rpm | cpio -i --make-directories
export LD_LIBRARY_PATH=./opt/dell/toolkit/lib/
sudo cp ./etc/omreg.cfg /etc/omreg.cfg
./opt/dell/toolkit/bin/syscfg


Enjoy !

Tuesday, January 27, 2015

Removing parport from loaded module

I did not want dmesg to contain:

[   25.662755] ppdev: user-space parallel port driver

All I needed to do is:

$ grep LP /etc/default/cups
# LOAD_LP_MODULE: enable/disable to load "lp" parallel printer driver module
LOAD_LP_MODULE=no

Thursday, September 11, 2014

Having fun with docbook

For some reason you need to apply the dbfo at different level to apply properties to an element:
<example>
<?dbfo pgwide="1"?> <!-- example level -->
<title>
Full example
</title>
<programlisting language="csharp">
<?dbfo keep-together="auto" ?> <!-- at programlisting level -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="MyCode.cs" parse="text"/></programlisting>
</example>
Reference: http://www.sagehill.net/docbookxsl/PageBreaking.html

Don't ask...

Monday, July 7, 2014

Error starting domain: internal error Network 'default' is not active.

# virsh net-start default
ref:
http://wiki.libvirt.org/page/Virtual_network_'default'_has_not_been_started

Friday, June 6, 2014

virt-manager: Can't choose ISO-image (remote connection, ssh)

While reading: https://bugs.debian.org/512253

I discovered that one need to restart virt-manager to get it to scan for new iso on the remote ssh.

Eg:

$ virt-manager
^C
$ scp *.iso remote:/var/lib/libvirt/images/
$ virt-manager
-> Browse -> "Locate ISO media volume"

Wednesday, April 30, 2014

Duplicating a repository on github

When following instructions from: https://help.github.com/articles/duplicating-a-repository

You need to change:

git remote set-url --push origin https://github.com/exampleuser/mirrored
into
git remote set-url --push origin git@github.com:exampleuser/mirrored

Otherwise you'll be asked for your Username:

$ git push --mirror
Username for 'https://github.com': 

Tuesday, April 29, 2014

usbmount: exfat !

Problem:

[1219466.592053] usb 8-1: new high-speed USB device number 5 using ehci_hcd
[1219466.725259] usb 8-1: New USB device found, idVendor=1b1c, idProduct=1a0a
[1219466.725264] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1219466.725268] usb 8-1: Product: Survivor 3.0
[1219466.725271] usb 8-1: Manufacturer: Corsair
[1219466.725273] usb 8-1: SerialNumber: 12345678000098765432
[1219466.744063] scsi10 : usb-storage 8-1:1.0
[1219467.756551] scsi 10:0:0:0: Direct-Access     Corsair  Survivor 3.0     1.00 PQ: 0 ANSI: 6
[1219467.757266] sd 10:0:0:0: Attached scsi generic sg7 type 0
[1219467.757784] sd 10:0:0:0: [sdh] 125132800 512-byte logical blocks: (64.0 GB/59.6 GiB)
[1219467.758154] sd 10:0:0:0: [sdh] Write Protect is off
[1219467.758159] sd 10:0:0:0: [sdh] Mode Sense: bf 00 00 00
[1219467.758526] sd 10:0:0:0: [sdh] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[1219467.761548]  sdh: sdh1
[1219467.763400] sd 10:0:0:0: [sdh] Attached SCSI removable disk

-> unknown filesystem type 'exfat'

Solution:

$ sudo apt-get install exfat-fuse
$ grep exfat /etc/usbmount/usbmount.conf
FILESYSTEMS="vfat ext2 ext3 ext4 ntfs-3g ntfs exfat hfsplus fuseblk"


mount/unmount the usb key !

Thursday, April 10, 2014

EXT4 / kimsufi

Server is not responding today. dmesg reveals:

ata1.00: exception Emask 0x0 SAct 0xf SErr 0x0 action 0x6 frozen
ata1.00: failed command: WRITE FPDMA QUEUED
ata1.00: cmd 61/08:00:30:1e:34/00:00:01:00:00/40 tag 0 ncq 4096 out
         res 40/00:00:09:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1.00: status: { DRDY }
ata1.00: failed command: WRITE FPDMA QUEUED
ata1.00: cmd 61/08:08:c0:78:24/00:00:01:00:00/40 tag 1 ncq 4096 out
         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1.00: status: { DRDY }
ata1.00: failed command: WRITE FPDMA QUEUED
ata1.00: cmd 61/68:10:50:f3:46/00:00:01:00:00/40 tag 2 ncq 53248 out
         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1.00: status: { DRDY }
ata1.00: failed command: WRITE FPDMA QUEUED
ata1.00: cmd 61/08:18:10:30:c4/00:00:00:00:00/40 tag 3 ncq 4096 out
         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1.00: status: { DRDY }
ata1: hard resetting link
ata1: link is slow to respond, please be patient (ready=0)
ata1: COMRESET failed (errno=-16)
ata1: hard resetting link
ata1: link is slow to respond, please be patient (ready=0)
ata1: COMRESET failed (errno=-16)
ata1: hard resetting link
ata1: link is slow to respond, please be patient (ready=0)
ata1: COMRESET failed (errno=-16)
ata1: limiting SATA link speed to 1.5 Gbps
ata1: hard resetting link
ata1: COMRESET failed (errno=-16)
ata1: reset failed, giving up
ata1.00: disabled
ata1.00: device reported invalid CHS sector 0
ata1.00: device reported invalid CHS sector 0
ata1.00: device reported invalid CHS sector 0
ata1: EH complete
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 00 c4 30 10 00 00 08 00
end_request: I/O error, dev sda, sector 12857360
Buffer I/O error on device sda1, logical block 1606658
EXT4-fs warning (device sda1): ext4_end_bio:244: I/O error writing to inode 393237 (offset 0 size 4096 starting block 1607171)
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 01 46 f3 50 00 00 68 00
end_request: I/O error, dev sda, sector 21427024
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 01 24 78 c0 00 00 08 00
end_request: I/O error, dev sda, sector 19167424
Buffer I/O error on device sda1, logical block 2395416
lost page write due to I/O error on sda1
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 01 34 1e 30 00 00 08 00
end_request: I/O error, dev sda, sector 20192816
Buffer I/O error on device sda1, logical block 2523590
lost page write due to I/O error on sda1
JBD2: Detected IO errors while flushing file data on sda1-8
Aborting journal on device sda1-8.
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10)
sd 0:0:0:0: [sda] Unhandled error code
: 2a 00 01 44 30 08 00 00 08 00
end_request: I/O error, dev sda, sector 21245960
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 00 00 10 00 00 00 08 00
end_request: I/O error, dev sda, sector 4096
Buffer I/O error on device sda1, logical block 0
lost page write due to I/O error on sda1
EXT4-fs (sda1): previous I/O error to superblock detected
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 00 00 10 00 00 00 08 00
end_request: I/O error, dev sda, sector 4096
Buffer I/O error on device sda1, logical block 0
lost page write due to I/O error on sda1
EXT4-fs error (device sda1): ext4_journal_start_sb:327: Detected aborted journal
EXT4-fs (sda1): Remounting filesystem read-only
------------[ cut here ]------------
WARNING: at fs/buffer.c:1153 mark_buffer_dirty+0x93/0xa0()
Hardware name: X8STi
Pid: 23035, comm: python Not tainted 3.2.13-grsec-xxxx-grs-ipv6-64 #1
Call Trace:
sd 0:0:0:0: [sda] Unhandled error code
 [<ffffffff81160bd3>] ? mark_buffer_dirty+0x93/0xa0
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
 [<ffffffff81089f3b>] warn_slowpath_common+0x7b/0xc0
sd 0:0:0:0: [sda] CDB: Write(10) [<ffffffff81089f95>] warn_slowpath_null+0x15/0x20
: 2a [<ffffffff81160bd3>] mark_buffer_dirty+0x93/0xa0
 00 00 [<ffffffff81229f82>] ext4_commit_super+0x172/0x240
 00 10 [<ffffffff8122b83e>] save_error_info+0x1e/0x30
 00 00 [<ffffffff8122bede>] __ext4_abort+0x12e/0x150
 00 08 [<ffffffff810f581c>] ? release_pages+0x23c/0x270
 00
 [<ffffffff810e9ba9>] ? find_get_pages+0x39/0x150
end_request: I/O error, dev sda, sector 4096
 [<ffffffff8122c78d>] ext4_journal_start_sb+0x8d/0x150
Buffer I/O error on device sda1, logical block 0
 [<ffffffff810f4e7f>] ? pagevec_lookup+0x1f/0x30
lost page write due to I/O error on sda1
 [<ffffffff8121ae2d>] ? ext4_meta_trans_blocks+0xad/0xc0
 [<ffffffff81234177>] ext4_ext_truncate+0x37/0x6a0
 [<ffffffff8110a8fc>] ? unmap_mapping_range+0x8c/0x190
 [<ffffffff8121c6e8>] ext4_truncate+0x78/0x80
 [<ffffffff8121c85e>] ext4_setattr+0x16e/0x550
 [<ffffffff8114e56e>] notify_change+0x10e/0x2d0
 [<ffffffff8113169f>] do_truncate+0x5f/0x90
 [<ffffffff811428f1>] do_last+0x891/0x920
 [<ffffffff81142a4f>] path_openat+0xcf/0x450
 [<ffffffff81142ee3>] do_filp_open+0x43/0xa0
 [<ffffffff8114f324>] ? expand_files+0x44/0x1e0
 [<ffffffff8114f50a>] ? alloc_fd+0x4a/0x140
 [<ffffffff81130612>] do_sys_open+0x152/0x1f0
 [<ffffffff811306db>] sys_open+0x1b/0x20
 [<ffffffff81b4c6b6>] system_call_fastpath+0x18/0x1d
---[ end trace 337b32de0e5629ad ]---
Buffer I/O error on device sda1, logical block 2655233
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 00 00 10 00 00 00 08 00
end_request: I/O error, dev sda, sector 4096
Buffer I/O error on device sda1, logical block 0
lost page write due to I/O error on sda1
EXT4-fs error (device sda1): ext4_journal_start_sb:327:
EXT4-fs error (device sda1): ext4_journal_start_sb:327: Detected aborted journalDetected aborted journal

lost page write due to I/O error on sda1
JBD2: I/O error detected when updating journal superblock for sda1-8.
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 75 84 ff 39 00 00 18 00
end_request: I/O error, dev sda, sector 1971650361
Aborting journal on device sda2-8.
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 75 84 10 01 00 00 08 00
end_request: I/O error, dev sda, sector 1971589121
Buffer I/O error on device sda2, logical block 241205248
lost page write due to I/O error on sda2
JBD2: I/O error detected when updating journal superblock for sda2-8.
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Read(10): 28 00 01 87 2f f0 00 00 20 00
end_request: I/O error, dev sda, sector 25636848
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Read(10): 28 00 01 87 2f f0 00 00 08 00
end_request: I/O error, dev sda, sector 25636848
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 0:0:0:0: [sda] CDB: Read(10): 28 00 01 87 2f f0 00 00 08 00
end_request: I/O error, dev sda, sector 25636848

Wednesday, February 12, 2014

Multi arched wine !

Finally !

$ apt-cache  policy wine32 wine64
wine32:i386:
  Installed: 1.6.2-6
  Candidate: 1.6.2-6
  Version table:
 *** 1.6.2-6 0
        500 http://ftp.fr.debian.org/debian/ sid/main i386 Packages
        100 /var/lib/dpkg/status
wine64:
  Installed: 1.6.2-6
  Candidate: 1.6.2-6
  Version table:
 *** 1.6.2-6 0
        500 http://ftp.fr.debian.org/debian/ sid/main amd64 Packages
        100 /var/lib/dpkg/status

Friday, December 20, 2013

OCR: multi-page pdf

I just discovered the excellent answer at:

http://askubuntu.com/questions/271271/how-do-i-produce-a-multi-page-sandwich-pdf-with-hocr2pdf

Basically, one just need (from a sid/schroot):

$ tesseract input.png output.hocr -l fra

Et voila !

Sunday, September 15, 2013

MP4 over UPnP to FreeBox v4 (minidlna)

i could only find one reference online on how to watch mp4 movie on a FreeBox v4:

http://legluondunet.over-blog.fr/article-freebox-lire-les-videos-au-format-mp4-sur-la-freebox-61411371.html

Unfortunately the conversion requires a GUI, which is bad[tm]. Instead i wrote a quick and dirty script to achieve something equivalent:



$ cat mp4tomkv.sh
#!/bin/sh

#set -x
in=$1
out=$(basename "$in" mp4)
out="${out}mkv"
mkvmerge --identify "$in" | grep Track > /tmp/dummy.txt
comp=""
while read line
do
tmp=`echo "$line" | cut -d' ' -f3`
comp="$comp --compression ${tmp}none"
done < /tmp/dummy.txt
echo "exec: mkvmerge -o $out $comp $in"
mkvmerge -q -o $out $comp $in

Tuesday, August 27, 2013

Clang, libc++ and ABI

I tried compiling GDCM with clang++ -stdlib=libc++, and here is what I get:

Linking CXX executable ../../bin/gdcminfo CMakeFiles/gdcminfo.dir/gdcminfo.cxx.o: In function `getInfoDate(Dict*, char const*)': /home/mathieu/Perso/gdcm/Applications/Cxx/gdcminfo.cxx:195: undefined reference to `Dict::lookup(char*, Object*, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >*)' CMakeFiles/gdcminfo.dir/gdcminfo.cxx.o: In function `getInfoString(Dict*, char const*, UnicodeMap*)': /home/mathieu/Perso/gdcm/Applications/Cxx/gdcminfo.cxx:257: undefined reference to `Dict::lookup(char*, Object*, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >*)' clang: error: linker command failed with exit code 1 (use -v to see invocation)
However:

$ nm -D /usr/lib/x86_64-linux-gnu/libpoppler.so | grep lookup | c++filt| grep \ Dict::lookup\( 00000000000c1870 T Dict::lookup(char*, Object*, std::set<int, std::less<int>, std::allocator<int> >*)


Thursday, July 11, 2013

btrfs is still considered experimental...

I started my Monday with a nice black screen saying that my debian did not boot properly. Upon reboot using 'recovery mode', I eventually discovered that the filesystem could not be mounted... sigh !

A year or so ago, I did setup my debian/squeeze (+bpo) using btrfs, after following an article from GNU/Linux Magazine which showed some cool feature of btrfs. However at that time, I did not read the warning message about 'btrfs being still experimental'.

Anyway, I need to get that fixed ASAP. kernel logs revealed something like:

 [...]
 parent transid verify failed on 201236885504 wanted 1822936 found 2125997

 parent transid verify failed on 201236885504 wanted 1822936 found 2125997
 btrfs: open_ctree failed


So I google for this error message, hoping someone already went through this. Found this thread:

http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg14960.html

Even if this thread recommends two tools:

http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg14974.html

This is not quite the same problem. After some more googling, I found out:

https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#I_can.27t_mount_my_filesystem.2C_and_I_get_a_kernel_oops.21

But then again, different symptoms imply different solutions.

So what remains ? I posted on btrfs@ and went on #btrfs

http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg25660.html

I was lucky and someone from #btrfs pointed me at the following trick from grub: try rebooting the system and edit the grub line to append 'bootflags=recovery'.

Luckily I had an old 3.4.0 (which is still more recent than the 3.2.0~bpo) to try out. Too bad 3.4.0 is still considered legacy from btrfs point of view and the -o recovery step failed.

So the next step is to get my hand at kernel 3.10 (which was released a week ago). No distribution had it pre-build, so I turned to knoppix 7.2.0 with kernel 3.9.6 to try out. Found a blank CD and burned the iso.

Once knoppix booted, I had access to a kernel 3.9.6 with -supposively- much better btrfs recovery mode.
After a keyboard change, I was ready to roll:

$ setxkbmap fr

So I tried:

$ sudo mount -v -t btrfs -o recovery -o degraded /dev/mapper/voxbox-root /tmp/bla


 device fsid abcdef01-2345-6789-aaaa-1234567890ab devid 1 transid 2207957 /dev/mapper/voxbox-root
 btrfs: enabling auto recovery
 btrfs: allowing degraded mounts
 parent transid verify failed on 201236885504 wanted 1822936 found 2125997
 parent transid verify failed on 201236885504 wanted 1822936 found 2125997
 btrfs: open_ctree failed

Ok so the problem is still present in kernel 3.9.6. As per people on #btrfs, I need to wait for the fusionio dev team to eventually show up... minutes felt like hours waiting for them.

While waiting for them, I discovered it is not easy (impossible?) to get an idea of how much data is stored on a volume. I tried pdisplay, vgdisplay, pvs but in all case you only know the actual allocated spaces. So how much disk do I need to restore my system, I can only have an upper guess from the allocated space:


http://www.redhat.com/archives/linux-lvm/2010-August/msg00011.html

Someone from the fusionio team finally shows up, told me to git pull / make & execute some commands:


$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
$ cd btrfs-progs/
$ make
$ ./btrfsck /dev/mapper/voxbox-root
parent transid verify failed on 201236885504 wanted 1822936 found 2125997
parent transid verify failed on 201236885504 wanted 1822936 found 2125997
parent transid verify failed on 201236885504 wanted 1822936 found 2125997
parent transid verify failed on 201236885504 wanted 1822936 found 2125997
Ignoring transid failure
Checking filesystem on /dev/mapper/voxbox-root
UUID: af7e6809-af9d-474f-a332-295cdba1c09f
checking extents
btrfsck: cmds-check.c:2063: check_owner_ref: Assertion `!(rec->is_root)' failed.
Aborted

So apparently this is not know issue. I was asked to use another git repository:


$ git clone -b for-knoppix https://github.com/josefbacik/btrfs-progs

Then did a couple of operation:


$ ./btrfsck /dev/mapper/voxbox-root
[...]
rec 201236885504 is a root isnt setup right, found ref? yes
btrfsck: cmds-check.c:2063: check_owner_ref: Assertion `!(rec->is_root)' failed.
Aborted
-> http://bpaste.net/show/DDBjB20mGNBZo2DJF7G3/

$ git pull
$ make
$ ./btrfsck /dev/mapper/voxbox-root


rec 201236885504's owner is 5, we want 7
rec 201236885504 is a root isnt setup right, found ref? yes
btrfsck: cmds-check.c:2064: check_owner_ref: Assertion `!(rec->is_root)' failed.
Aborted
-> http://bpaste.net/show/MRbYkkpRAkbwDcwdIGwW/

Apparently this looked easy (understandable), so I was asked to run:

$ ./btrfsck -s 1 /dev/mapper/voxbox-root
[...]
rec 201236885504's owner is 5, we want 7
rec 201236885504 is a root isnt setup right, found ref? yes

-> http://bpaste.net/show/6QZjOib5Rqx8xdipYOkB/

and


$ ./btrfsck -s 2 /dev/mapper/voxbox-root 
[...]
rec 201236885504's owner is 5, we want 7
rec 201236885504 is a root isnt setup right, found ref? yes
-> http://bpaste.net/show/SuzvqAZ5ZLjykXErA1yU/

But then it was no longer as easy, so the dev told me he would need a couple of hours to write a patch. Meanwhile I could run a restore operation at least to backup my data:


https://btrfs.wiki.kernel.org/index.php/Restore

So I went to a store and bought a USB drive (3Tb since I had no clue how space I would need). Format the NTFS partition, and replace it with EXT4, then mount it. Now I can run the restore:

$ ./btrfs restore /dev/mapper/voxbox-root /media/sdh/1/

24 hours later, the restore was complete ! All metadatas (ctime, atime...) are lost but at least I have all my files. And to answer my own question, I needed only a 2Tb USB drive:


$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb              2.7T  1.6T 1016G  62% /media/voxboxbackup


A couple of hours the dev guy (josef) shows up with a patch for me:

https://github.com/josefbacik/btrfs-progs/commit/1079ddc4d6c4df516c4e483278d2d6390bab0f93

So I git pull & make. Now I am on my way to actually running the repair operation:

$ ./btrfs --init-csum-tree /dev/mapper/voxbox-root

Creating a new CRC tree
parent transid verify failed on 201236885504 wanted 1822936 found 2125997
parent transid verify failed on 201236885504 wanted 1822936 found 2125997
parent transid verify failed on 201236885504 wanted 1822936 found 2125997
parent transid verify failed on 201236885504 wanted 1822936 found 2125997
Ignoring transid failure
Checking filesystem on /dev/mapper/voxbox-root
UUID: af7e6809-af9d-474f-a332-295cdba1c09f
checking extents
Reinit crc root

[more to come]

Friday, May 31, 2013

How to corrupt dmesg output

Here is one funky issue with gold (binutils-gold package):

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=710023

You can reproduce it on any debian oldstable (squeeze) running on amd64. You simply need to install gold:


$ sudo apt-get install binutils-gold

Tuesday, January 1, 2013

minidlna on squeeze

I wanted to try minidlna on my Mac Mini/G4 with debian squeeze. Here is what I did:

$ apt-get source minidlna
$ cd minidlna-1.0.24+dfsg
$ quilt pop
$ vim debian/patches/series
-> comment last patch:
#0021-Use-run-instead-of-var-run-to-store-runtime-files.patch
$ vim debian/minidlna.init
-> change /run into /var/run
PIDDIR=/var/run/$NAME
$ vim debian/minidlna.postrm
-> change /run into /var/run
PIDDIR=/var/run/minidlna
$ dpkg-buildpackage -rfakeroot -us -uc
$ sudo dpkg -i ../minidlna_1.0.24+dfsg-1_powerpc.deb
$ sudo vim /etc/minidlna.conf
-> add location for *.avi files:
media_dir=V,/home/mathieu/Videos
$ sudo /etc/init.d/minidlna restart

Your minidlna server should appears from your Freebox menu ! Just as with mediatomb, the 'Delete' from the Freebox menu does not work...

ref:
http://doc.ubuntu-fr.org/minidlna

Tuesday, December 25, 2012

Windows Update does not work

Simple:

  1. Click "start", "cmd",
  2. Right click "Run as administrator"
  3. Type "net stop wuauserv"
  4. Type "ren %windir%\softwaredistribution sd.old"
  5. Type "net start wuauserv"
  6. Reboot
  7. Now you can use windows update again


Monday, December 17, 2012

gdcm and submodule gdcmData


During migration, the tool simply copy/pasted the old submodule URL, which lead to inconsistencies such:

$ git clone --recursive git://git.code.sf.net/p/gdcm/gdcm
Cloning into 'gdcm'...
remote: Counting objects: 65664, done.
remote: Compressing objects: 100% (13537/13537), done.
remote: Total 65664 (delta 51934), reused 65658 (delta 51930)
Receiving objects: 100% (65664/65664), 20.31 MiB | 2.32 MiB/s, done.
Resolving deltas: 100% (51934/51934), done.
Submodule 'Testing/Data' (git://gdcm.git.sourceforge.net/gitroot/gdcm/gdcmData) registered for path 'Testing/Data'
Cloning into 'Testing/Data'...
remote: Counting objects: 438, done.
remote: Compressing objects: 100% (303/303), done.
remote: Total 438 (delta 134), reused 428 (delta 131)
Receiving objects: 100% (438/438), 160.33 MiB | 7.25 MiB/s, done.
Resolving deltas: 100% (134/134), done.
Submodule path 'Testing/Data': checked out 'ebd3260d5dd315dd99dae78c783c2fc1beb18f01'
Well, this is not really an issue, we will just delete the old submodule and point to the new one.

Seems easy ? Well not quite, the new Allura does not cope with Upper case in name for mount point, so gdcmData needs to be gdcmdata now ...

Update: the following page explains how to delete (rm) submodule:
http://chrisjean.com/2009/04/20/git-submodules-adding-using-removing-and-updating/