вторник, 6 януари 2015 г.

Card reader stopped detecting my SD card

A little card reader fun before going to bed.
So we needed to format a 16GB SD card to ext4, it was formatted as fat32 (who the hell uses this format besides cameras?). So at first, my Sabayon wasn't detecting it at all. After starting gparted it appeared, but it couldn't be formatted to ext4 (gave couple of errors). Then we tried formatting it manually and we got:
$sudo mkfs.ext4 -n 'LUbuntu' -I /dev/sdb1
   mkfs.ext4: invalid inode size - /dev/sdb1
Another try to reformat it as fat32.
$sudo mkfs.vfat -n 'LUbuntu' -I /dev/sdb1
mkfs.fat 3.0.26 (2014-03-07)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mkfs.vfat: unable to open /dev/sdb1: Device or resource busy
 $ sudo mkfs.vfat -n 'LUbuntu' -I /dev/sdb1
mkfs.fat 3.0.26 (2014-03-07)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
/dev/sdb1: No medium found
Then the card reader stopped detecting the card at all and it wasn't visible with $df or $fdisk -l.
I checked dmesg:
sudo dmesg|tail  
[238472.867688] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.867742] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.867825] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.867891] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.867965] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.868054] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.868131] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.868207] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.868277] FAT-fs (sdb1): Directory bread(block 8192) failed
[238615.530731] sdb: detected capacity change from 15803088896 to 0
After some googling it turned out that there is a solution. I did:
$sudo fsck.vfat -nVv /dev/sdb1
fsck.fat 3.0.26 (2014-03-07)
fsck.fat 3.0.26 (2014-03-07)
Logical sector size is zero.
which changed my dmesg to:
sudo dmesg|tail
[238472.867825] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.867891] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.867965] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.868054] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.868131] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.868207] FAT-fs (sdb1): Directory bread(block 8192) failed
[238472.868277] FAT-fs (sdb1): Directory bread(block 8192) failed
[238615.530731] sdb: detected capacity change from 15803088896 to 0
[240604.657313] sd 7:0:0:0: [sdb] 30865408 512-byte logical blocks: (15.8 GB/14.7 GiB)
[240604.786064]  sdb: sdb1
YAY!
Then I started gparted and formatted it to ext4 without any problem.
It's great when things end well, right? :)
Now let's see this Banana Pi.

неделя, 7 декември 2014 г.

Unable to mount NTFS partition

My external hard drive failed to mount its NTFS partition giving me the following error:
"on-zero exit status 13: $MFT must be non-resident. Failed to load $MFT: Input/output error Failed to mount '/dev/sdd1': Input/output error".
I thought I ruined once again my NTFS partition (this happens every now and then, because of my reckless copying of files), but the answer was quite simple.
I executed:
$sudo ntfsfix /dev/sdd1
and that fixed the problem immediately. Obviously this time I didn't make quite a mess.

сряда, 12 ноември 2014 г.

How to change the comma like a decimal separator

I have absolutely no idea why my Sabayon uses the comma as a decimal separator, but it does. Go figure. Anyway, it turned out, you can see your locale settings by typing
$locale
in BASH. An it will return a list of the setting used for different things like Date, Currency etc. Since I care only about numerical activities, this is the only thing I wanted to change.

So I found that this could be changed from SystemSettings->Locale, but since you need to log out for this to work, I found a simple way.

To do it just for the session, do
$ export LC_NUMERIC="en_US.UTF-8" 
This will change the separator to my beloved point. You can add this to ~/.bashrc or ~/.bash_profile to make it permanent, but I think that SystemSettings will do the trick for you anyway.