Solution 1:

This is a known bug in Ubuntu, dating back to 2006 :
Bug #77370 : Laptop Fan always on after resume from suspend to RAM.

The above is a very long thread going on for 6 years, concluding that this problem happens on some kernel versions, but not on all.

Some solutions were listed, going from unplug/replug the power cord to creating a script to run after resume to stop the fan.

The script in question is created as file /etc/pm/sleep.d/99fancontrol (remember to chmod 755) :

#!/bin/sh
#
# Stop the fan.
# Source: https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.17/+bug/77370

case "$1" in
 hibernate|suspend)
  # Stopping is not required.
  ;;
 thaw|resume)
# In background.
   ( sleep 10 ; echo -n "0" > /sys/devices/virtual/thermal/cooling_device1/cur_state ) &

  ;;
 *) exit $NA
  ;;
esac

Solution 2:

You may try to configure the Fan Speed based on Temperatures. Here's how to do it

(Please note this example was a translation of an old blog article from me in french for Ubuntu Karmic Koala... Hope my "prose" is readable in english!)

Fan Monitoring and Control

In a Terminal enter: pwmconfig and follow these steps

EXAMPLE:

1) First step: pwmconfig search for Power Waves Monitors

Found the following devices:
hwmon0/device is w83697hf

Found the following PWM controls:
hwmon0/device/pwm1
hwmon0/device/pwm2

Giving the fans some time to reach full speed…
Found the following fan sensors:
hwmon0/device/fan1_input     current speed: 0 … skipping!
hwmon0/device/fan2_input     current speed: 4326 RPM

2) Second Step:

pwmconfig check if there is a correlation a PWM control and a fan by trying to stop it. By confirming to pwmconfig the fan is actually stopped this associate pwmconfig to a specific fan.

Testing pwm control hwmon0/device/pwm1 …
hwmon0/device/fan2_input … speed was 4326 now 4326
no correlation

{If pwmconfig do not detect such fan it ask you to confirm…}

No correlations were detected.
There is either no fan connected to the output of hwmon0/device/pwm1,
or the connected fan has no rpm-signal connected to one of the tested fan sensors.

Did you see/hear a fan stopping during the above test (n)? n

{Here pwmconfig check the next pwm control…}

Testing pwm control hwmon0/device/pwm2 …
hwmon0/device/fan2_input … speed was 4326 now 0
It appears that fan hwmon0/device/fan2_input
is controlled by pwm hwmon0/device/pwm2

{Here pwmconfig has found the correlation and keep it in the configuration file /etc/fancontrol}

3) Third step: it's also possible to set the pwmconfig variables

Minimal Temperature detected by the sensor: MINTEMP Maximal Temperature detected by the sensor: MAXTEMP Minimal Temperature for Fan startup: MINSTART Minimal Temperature for Fan Stop: MINSTOP

If you receive a message like: "File /var/run/fancontrol.pid exists." his typically means that the fancontrol deamon is running.You should stop it before running pwmconfig. If you are certain that fancontrol is not running, then you can delete /var/run/fancontrol.pid manually.

4) Fourth Step: run this command "fancontrol stop" then "pwmconfig" which give you an output like this:

Select fan output to configure, or other action:
1) hwmon0/device/pwm2  3) Just quit          5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 1

4.1 {Here I choose "1": the pwm control corresponding to the sensor in use}

Devices:
hwmon0/device is w83697hf

Current temperature readings are as follows:
hwmon0/device/temp1_input    30
hwmon0/device/temp2_input    57

Select a temperature sensor as source for hwmon0/device/pwm2:
1) hwmon0/device/temp1_input
2) hwmon0/device/temp2_input
3) None (Do not affect this PWM output)
select (1-n): 2

4.2 {Here I choose "2": le contrôle pwm control corresponding to the active sensor}

Enter the low temperature (degree C)
below which the fan should spin at minimum speed (0): 38

4.3 {Here I choose "38": the lower temperature under which the Fan speed is at minimum }

Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 48

4.5 {Here I choose "48": the temperature over which the Fan speed is at maximum }

Enter the minimum PWM value (0-255)
at which the fan STARTS spinning (press t to test) (150): t

4.6 {Here I choose "t": to try and enter "y" when the maximal pwm value = Fan startup }

Now we increase the PWM value in 10-unit-steps.
Let the fan stop completely, then press return until the
fan starts spinning. Then enter ‘y’.
We will use this value +20 as the starting speed.
Setting hwmon0/device/pwm2 to 10…
Setting hwmon0/device/pwm2 to 20…
Setting hwmon0/device/pwm2 to 30…
Setting hwmon0/device/pwm2 to 40…
Setting hwmon0/device/pwm2 to 50…
Setting hwmon0/device/pwm2 to 60…  y
OK, using 60

Enter the minimum PWM value (0-255)
at which the fan STOPS spinning (press t to test) (100): t

4.7 {Here I choose "t": to try and enter "y" when the pwm minimal value = Fan stop}

Now we decrease the PWM value in 10-unit-steps.
Let the fan reach full speed, then press return until the
fan stops spinning. Then enter ‘y’.
We will use this value +20 as the minimum speed.
Setting hwmon0/device/pwm2 to 245…
Setting hwmon0/device/pwm2 to 235…
Setting hwmon0/device/pwm2 to 225…
Setting hwmon0/device/pwm2 to 215…
Setting hwmon0/device/pwm2 to 205…
Setting hwmon0/device/pwm2 to 195…
Setting hwmon0/device/pwm2 to 185…
Setting hwmon0/device/pwm2 to 175…
Setting hwmon0/device/pwm2 to 165…
Setting hwmon0/device/pwm2 to 155…
Setting hwmon0/device/pwm2 to 145…
Setting hwmon0/device/pwm2 to 135…
Setting hwmon0/device/pwm2 to 125…
Setting hwmon0/device/pwm2 to 115…
Setting hwmon0/device/pwm2 to 105…
Setting hwmon0/device/pwm2 to 95…
Setting hwmon0/device/pwm2 to 85…
Setting hwmon0/device/pwm2 to 75…
Setting hwmon0/device/pwm2 to 65…
Setting hwmon0/device/pwm2 to 55…
Setting hwmon0/device/pwm2 to 45…  y
OK, using 45

4.8 {Finally enter the minimum and maximum pwm values… }

Enter the PWM value (0-45) to use when the temperature
is below the low temperature limit (0): 24

Enter the PWM value (45-255) to use when the temperature
is over the high temperature limit (255): 255

==>> Note these values may be later ajusted to fit your needs...

==>> Don't forget to save the configuration!

Select fan output to configure, or other action:
1) hwmon0/device/pwm2  3) Just quit          5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): **4**

Done! :)

Hope this help keeping your fans less noisy! Let us know. :)