Archive for the ‘Ubuntu’ Category

Eliminating crackling/distorted noise on Intel Mac computers running Ubuntu/Linux

on Saturday 17th May, 2008 Gabe speculated thusly…

I have a first generation macbook coreduo.

The latest version of Ubuntu (Hardy Heron 8.04 LTS) works very well on it with minimal configuration. However, several issues remain. One of which is the poor sound quality. Initially, installing linux-backports-modules did the trick, however after several reboots it became clear that it didn’t always work. I came across this post, which I followed and the results were outstanding. I have completely copied it here, only to make sure there is another copy of this important document. Full credit for this one goes to the original author. Anyway, here’s what you need to do:

Edit the file /etc/modprobe.d/options
$ sudo vim /etc/modprobe.d/options

And add the following to the end of the file:
options snd-hda-intel model=[MODEL_BELOW] position_fix=2 probe_mask=1

Run the following command:
$ sudo update-initramfs -u

Then reboot.

You must select the Intel HDA model that corresponds to your computer:

These are the codes you can use in the above instructions:
intel-mac-v1 : Intel Mac Type 1
intel-mac-v2 : Intel Mac Type 2
intel-mac-v3 : Intel Mac Type 3
intel-mac-v4 : Intel Mac Type 4
intel-mac-v5 : Intel Mac Type 5
macmini : Intel Mac Mini (equivalent with type 3)
macbook : Intel Mac Book (eq. type 5)
macbook-pro-v1 : Intel Mac Book Pro 1st generation (eq. type 3)
macbook-pro : Intel Mac Book Pro 2nd generation (eq. type 3)
imac-intel : Intel iMac (eq. type 2)
imac-intel-20 : Intel iMac (newer version) (eq. type 3)

For example, I have a Macbook 1st generation, and the only setting that worked was
model=intel-mac-v1. All others just gave me no sound at all, including the apparently
obvious macbook and the documented-as-equivalent macmini ones.

If nothing works, you can revert this by deleting the line and performing the rest of the steps.

For BEST sound, if the above works, open a terminal and type:
$ alsamixer

And set the front and surround sliders to their maximum.
It might be necessary to unmute them with the ‘M’ key.
Press ESC twice to leave the program.

Posted in HowTo, Information, Linux, Operating System, Ubuntu

No Comments »

Setup a fileserver using RAID 1 & 5 on Ubuntu Hardy Heron 8.04 LTS Server

on Tuesday 13th May, 2008 Gabe speculated thusly…

I recently set up a new file server. It contains three 1 terabyte drives configured in a RAID 5 array but with RAID 1 for the boot partitions so in the event of drive failure the system could still boot.

Essentially you need to go through a normal installation process and make sure you choose a couple of things during parition setup. I split each of the 3 drives in to two partitions, one 200MB, and the other partition the remaining disc space. This is what I had:
sda1 = 200MB
sda2 = 9800MB
and the same for the other drives.

Set all sda1 partition to be ext3 and bootable and mounted as /boot, set sdb1 and sdc1 partitions to be Linux Software Raid, bootable, but not mounted. Configure the RAID and create a new RAID device, tell it to use three devices and add to it sda2, sdb2, and sdc2.

When I returned to the partition menu I configured md0 as a partition for a logical volume group. I then configured LVM and created logical volumes for /root, swap, and /home. Returning to the partitioning menu I formatted these and selected their mount points and installed the system.

Following system installation I went about creating a RAID 1 array for sda1, sdb1, and sdc1. First thing was to create a new array using mdadm and the two paritions we haven’t yet assigned:
# mdadm --create /dev/md1 --level=1 --raid-disks=3 missing /dev/sdb1 /dev/sdc1

Make a filesystem on our new RAID device:
# mkfs.ext3 -m 0 /dev/md1

Save the new configuration in to mdadm’s config file:
# mdadm --examine --scan >> /etc/mdadm/mdadm.conf

Edit mdadm.conf and remove the duplicate entry at the bottom:
# vim /etc/mdadm.conf

Mount the new RAID device so we can copy data to it:
# mkdir /media/md1
# mount /dev/md1 /media/md1

Copy over the boot partition to the RAID device:
# cd /boot
# cp -dpRx . /media/md1

Edit fstab and replace /dev/sda1 with /dev/md1:
# vim /etc/fstab

Edit mtab and do the same:
# vim /etc/mtab

Unmount /boot, change it’s system type and add it to the RAID array:
# umount /boot
# fdisk /dev/sda
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): f
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): w

# mdadm --add /dev/md1 /dev/sda1

Configure GRUB so that it can boot from any hard drive:
# grub
grub> device (hd0) /dev/sda
grub> root (hd0,0)
grub> setup (hd0)
grub> device (hd0) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)
grub> device (hd0) /dev/sdc
grub> root (hd0,0)
grub> setup (hd0)
grub> quit

# update-initramfs -u

Change all occurance of (hd*) to (hd0) in the file /boot/grub/devices.map.

That should be all - good luck with the reboot!
# reboot

Posted in Books, Development, Guide, Information, Linux, Operating System, Server, Ubuntu

No Comments »

Installing Netatalk AFP with SSL (encrypted authentication) on Ubuntu Hardy Heron 8.04 LTS Server

on Monday 12th May, 2008 Gabe speculated thusly…

Installing Netatalk from the repositories means that when you connect using a Mac client you will be warned that you are going to send your password in the clear. Obviously this isn’t great for security, and being prompted every time you want to connect is annoying. This occurs because Netatalk in the Ubuntu repositories is compiled without SSL support (SSL is what handles the encryption).

The key to getting this to work is to get the Netatalk source code and compile it yourself. Don’t worry, it’s been done hundreds of times before and if you follow this tutorial closely you should be fine.

The commands written always start with a dollar sign ($), you should not type this, it just indicates the commands should be typed at a standard user prompt in the terminal.

First off it’s a good idea to switch to your home directory:
$ cd ~

Make a new directory to hold the hundreds of small Netatalk files:
$ mkdir netatalk

Ensure you have essential development libraries and tools installed:
$ sudo aptitude install libdb4.2-dev libslp-dev autotools-dev devscripts cracklib2-dev dpkg-dev libssl-dev

Change in to the newly created directory:
$ cd netatalk

Install the netatalk source code:
$ sudo apt-get source netatalk

Install all required dependencies for netatalk:
$ sudo apt-get build-dep netatalk

A new directory called netatalk-2.0.3 should have been created, change in to that directory:
$ cd netatalk-2.0.3

Compile Netatalk with the SSL option:
$ DEB_BUILD_OPTIONS=ssl sudo dpkg-buildpackage -us -uc

Install the finished product!:
$ sudo debi

Posted in HowTo, Information, Linux, Operating System, Server, Ubuntu

3 Comments »

Upgrading Ubuntu Gutsy Gibbon 7.10 Server to Ubuntu Hardy Heron 8.04 LTS Server

on Tuesday 6th May, 2008 Gabe speculated thusly…

Today I upgraded a server that was running Gutsy AMD64 arch. I wanted to note in this blog that the update went well, and the result is what seems to be a perfectly good Hardy Heron system. This is what I did from the command line:
sudo aptitude install update-manager-core

followed by:
sudo do-release-upgrade

Went through it all. Sometimes got prompted about config files - whether to keep my version or install package maintainers version. I chose to install the maintainers in case there were some important new config options (I had backups of my config files). These were mostly related to Apache and PHP. Having gone through the config files I can say that it is safe to choose to keep your config files (if upgrading from Gutsy). If you’re going from Dapper you probably should check.

Posted in Linux, Operating System, Ubuntu

No Comments »