неделя, 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.

сряда, 30 юли 2014 г.

How to make a bootable USB under linux

I'm ashamed to admit it, but it turned out I need to install Windows to check whether all my hardware is working properly (because I have no way to know if it's not working or simple not recognized by Sabayon). So I needed to make a bootable USB.
I tried untebootin and winusb, but both didn't work, for different reasons.I tried also with what seemed most likely to work - dd:
$sudo dd if=/path/to/iso/windows.iso of=/dev/sdg bs=4M; sync
both with ntfs partition and fat32 partition, but somehow dd destroyed the partition table and the USB was unbootable.
So here's what worked for me in the end:
Of course, first you need to locate and empty your USB from everything important.
1. To find the device of your usb:
$sudo fdisk -l
2. Unmount the USB (say it's /dev/sdc1):
$umount /dev/sdc1
3. Format it as FAT 32 - I also have no idea if this is essential, but it worked.
$sudo mkdosfs -n 'USB-Drive-Name' -I /dev/sdc -F 32
4. Mount the ISO you have the usual way:
$mount -o loop /path/to/win.iso /usual/mount/directory
5. Go to your loop directory (it appeared in Dolphine sidebar for me) and copy all the files there to your USB (you'll have to mount it for this).
6. Unmount your USB and reboot to use it.
These steps follow partially this link, I changed only the last steps, where they use dd to copy the iso. I tried this, but again, I got unbootable USB. I tried also partitioning it with gparted and setting a boot flag, but again, after using dd, the partition table was gone. Maybe there is a simple way to do it with dd, I just don't know it and couldn't find it quickly enough.