Mascote

notes to self.

Solving Problem With Symlinks and Mac OS X on Samba

Some Mac OS X machines has a problem with symlinks on Samba, to fix this just add to your /etc/samba/smb.conf:

1
2
unix extensions = no
wide links = yes

And reload the smbd daemon.

Cheers.

New Life for a Dead Kindle Fire HD

After a failed attempt to write a bootloader using a wrong image in Kindle Fire HD 7“ from a friend, was totally dead, black screen, no sign of life.

As I went through this with my Galaxy Nexus who also has an OMAP4 CPU, I decided to follow the same steps to retrieve it using the usbboot. For this it was necessary to remove the battery and solder a small wire connecting pin USB Boot to GND to be recognized as omap44xx usb device in my linux PC.

The pin in question is below:

1
2
3
_______________* * 
this pin ---->[*]*
_______________* * 

After that, just download and compile the usbboot through the sources that can be found here.

Good luck.

Replacing a Failing Disk on CentOS 6

Create a identical partition map from the original disk:

1
# sfdisk -d /dev/sda | sfdisk --force /dev/sdb

search the UUID of /boot partition:

1
2
3
4
# dumpe2fs -h /dev/sda1 | grep UUID

dumpe2fs 1.42 (29-Nov-2011)
Filesystem UUID:          d22792ce-822a-4eeb-9e4f-1522214026c6

create a same filesystem type in new disk:

1
# mkfs.ext4 -U d22792ce-822a-4eeb-9e4f-1522214026c6 /dev/sdb1

copy /boot content to new disk mounted at /mnt:

1
2
3
# mount /dev/sdb1 /mnt

# rsync -avrP /boot /mnt

set the new disk as hd0 on grub:

1
2
3
# grub 
grub> find /grub/stage1
grub> device (hd0) /dev/sdb

We made the second drive /dev/sdb device (hd0) because putting grub on it this way puts a bootable mbr on the 2nd drive and when the first drive is missing the second drive will boot.

install grub on new device:

1
2
3
grub> root (hd0,0)
grub> setup (hd0)
grub> quit

add the new disk partition to volume group:

1
# vgextend VolGroup00 /dev/sdb2

move content from old to new disk:

1
# pvmove /dev/sda2 /dev/sdb2

remove old disk partition from volume group:

1
# vgreduce VolGroup00 /dev/sda2

now, you can remove the old disk without reboot, to disable the disk to remove safely:

1
# echo 1 > /sys/block/sda/device/delete

enjoy!

Fix Slow Transfer Between Mac OS X and Samba

Mac OS X has a big problem with samba when delayed ack is active, to avoid this start Terminal.app as root and set delayed ack to 0:

1
sudo sysctl -w net.inet.tcp.delayed_ack=0

Make the change permanent creating the file /private/etc/sysctl.conf if not exists:

1
echo 'net.inet.tcp.delayed_ack=0' >> /private/etc/sysctl.conf

try upload a big file and you will see a better throughput than before.