Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: Ubuntu netbook remix- overschakelen op ext2  (gelezen 1325 keer)

Offline dirk1965

  • Lid
Ubuntu netbook remix- overschakelen op ext2
« Gepost op: 2008/12/02, 18:03:39 »
Nadat Pjotr me de raad had gegeven om mijn SSD te vrijwaren van vroegtijdige slijtage door de ext3 partitie om te zetten in ext2 ben ik eens gaan rondkijken, maar de instructies die ik vind zijn niet compatibel met mijn Ubuntu NMR. (https://help.ubuntu.com/community/AspireOne)
In /etc/fstab vind ik niks terug van wat er daar beschreven staat. Is het nu voldoende om gedit /etc/fstab te doen en daar ext3 in ext2 te veranderen en dan op te slaan of sla ik hier een heleboel over? (of is het probleem van journalling al aangepakt in de netbook remix zelf?)

Offline Pjotr

  • Lid
    • Makkelijke Linuxtips
Re: Ubuntu netbook remix- overschakelen op ext2
« Reactie #1 Gepost op: 2008/12/02, 18:11:09 »
Ik denk niet, dat de Netbook Remix standaard rekening houdt met slijtagebeperking van de SSD. Want er zijn immers heel veel soorten netboekjes, en de meeste hebben een gewone harde schijf.

Dit is dus het onderdeel dat je zelf wil doen:

OPTIMIZING SSD PERFORMANCE:

    *

      Note: (Skip this step if you have the hard disk Acer Aspire One)

The performance of the SSD drive can be significantly improved by a few tweaks described in an article by Jason Perlow (But ignore Tweak #1, which does not apply.). The most important of these are described here.

Change the file system mount options on SSDs to “noatime”

Edit /etc/fstab (sudo gedit /etc/fstab) and change the the option “relatime” to “noatime”. The line for the root partition should then be something like:

UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d / ext2 noatime,errors=remount-ro 0 1

Use the “noop” I/O scheduler

Edit /boot/grub/menu.lst using your favorite editor, and add "elevator=noop" as an option. The default kernel configuration, found in the last part of the file should be something like:

title           Ubuntu 8.04.1, kernel 2.6.24-19-generic
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.24-19-generic root=UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d ro quiet splash elevator=noop
initrd          /boot/initrd.img-2.6.24-19-generic
quiet

In order for the changes to remain when updating the kernel, also in menu.lst, find the line

# defoptions=quiet splash

and add "elevator=noop" as an option:

# defoptions=elevator=noop quiet splash

REDUCING SSD WEAR:

    *

      Note: (Skip this step if you have the hard disk Acer Aspire One)

Frequent writes to the SSD will cause failure eventually. We can reduce the number of writes to the SSD by moving our logs to a temporary filesystem in RAM that gets destroyed at ever reboot. Now this means your logs will not be persistent across reboots making debugging difficult in some cases. This step is optional of course, so if you need the logs for an extended period of time do not follow these steps.

Open your fstab again, and add the following lines:

sudo gedit /etc/fstab
tmpfs      /var/log        tmpfs        defaults           0    0
tmpfs      /tmp            tmpfs        defaults           0    0
tmpfs      /var/tmp        tmpfs        defaults           0    0

There is currently a bug in sysklogd where it cannot handle booting with an empty /var/log directory (bug #290127). This can be fixed by modifying /etc/init.d/sysklogd:

Find this function:

fix_log_ownership()
        for l in `syslogd-listfiles -a`
        do
                chown ${USER}:adm $l
        done
}

..and replace it with this:

fix_log_ownership()
{
        for l in `syslogd-listfiles -a --news`
        do
                # Create directory for logfile if required
                ldir=$(echo ${l} | sed  's/[^\/]*$//g')
                if [ ! -e $ldir ] ; then
                        mkdir -p $ldir
                fi
                # Touch logfile and chown
                touch $l && chown ${USER}:adm $l
        done
}

Warning: this will cause some packages to fail mysteriously when they cannot access the log directories that were installed with the packages and then disappeared at reboot.

To rebuild the rest of the directory structure inside /var/log on each reboot, add these lines to /etc/rc.local above the 'exit 0' line:

for dir in apparmor apt cups dist-upgrade fsck gdm installer samba unattended-upgrades ; do
        if [ ! -e /var/log/$dir ] ; then
                mkdir /var/log/$dir
        fi
done


DISABLE SCROLLKEEPER:

(Skip this step if you have the hard disk Acer Aspire One)

ScrollKeeper is a cataloging system for documentation on open systems. Hardly anyone ever uses it and on the AAO's slow SSD it takes ages every time you install anything. Disable it and your installs will fly! Finally add a diversion to stop dpkg from overwriting your changes.

sudo mv /usr/bin/scrollkeeper-update /usr/bin/scrollkeeper-update.real
sudo ln -s /bin/true /usr/bin/scrollkeeper-update
sudo find /var/lib/scrollkeeper/ -name \*.xml -type f -exec rm -f '{}' \;
sudo dpkg-divert --local --divert /usr/bin/scrollkeeper-update.real --add /usr/bin/scrollkeeper-update

En ook nog deze, vooral die met de swappiness-beperking:

TWEAKS FOR POWERSAVING (Optional):

Add the following to the /etc/rc.local file:

# Economize the SSD
sysctl -w vm.swappiness=1               # Strongly discourage swapping
sysctl -w vm.vfs_cache_pressure=50      # Don't shrink the inode cache aggressively

# As in the rc.last.ctrl of Linpus
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 20 > /proc/sys/vm/dirty_ratio
echo 10 > /proc/sys/vm/dirty_background_ratio

echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
echo 10 > /sys/module/snd_hda_intel/parameters/power_save
echo 5 > /proc/sys/vm/laptop_mode

#Decrease power usage of USB while idle
[ -w /sys/bus/usb/devices/1-5/power/level ] && echo auto > /sys/bus/usb/devices/1-5/power/level
[ -w /sys/bus/usb/devices/5-5/power/level ] && echo auto > /sys/bus/usb/devices/5-5/power/level

Offline dirk1965

  • Lid
Re: Ubuntu netbook remix- overschakelen op ext2
« Reactie #2 Gepost op: 2008/12/02, 20:01:26 »
Wel dat is dus het probleem. Als ik gedit /etc/fstab doe krijg ik enkel dit:
/dev/sda1       /               ext3 defaults   0 0
proc         /proc         proc   defaults   0 0

Dit is alles wat er in het venster staat. Daarmee dat ik dacht dat de SSD-slijtagekwestie misschien al behandeld was in netbook remix. Hetgeen je beschrijft gaat nl over een 'gewone' hardy installatie.

Offline vanadium

  • Lid
Re: Ubuntu netbook remix- overschakelen op ext2
« Reactie #3 Gepost op: 2008/12/02, 20:30:42 »
Dat lijkt mij een minimale /etc/fstab, zeker niet geoptimaliseerd voor de SSD slijtagekwestie. Je kan alvast de noatime optie toevoegen.

Als het al niet mogelijk is een ext3 schijf om te zetten naar ext2, dan moet het vast wel mogelijk zijn een ext3 schijf als een ext2 schijf te gebruiken. Dat is wat de ext driver voor Windows doet. Misschien nog eens zoeken. Het zou mij niet verbazen mocht het volstaan gewoon de schijf als ext2 te mounten. Kijk ook eens naar tune2fs.

Wat het tijdelijk bestandssysteem in ram betreft: dat zal wel geheugen kosten, en in een netboekje heb je typisch geen geheugen te veel: even overwegen of je dat wel wil doen. Misschien wel als je 1 gigabyte hebt.

Offline dirk1965

  • Lid
Re: Ubuntu netbook remix- overschakelen op ext2
« Reactie #4 Gepost op: 2008/12/02, 21:04:33 »
Ik veronderstel dat het niet volstaat om die 3 in een 2 te veranderen in een gedit venster want als ik sudo umount /dev/sda1 doe krijg ik de melding:
umount: /: apparaat is bezig
umount: /: apparaat is bezig
Ik kan me wel voorstellen dat hij bezig is, de AA1 draait hier nl op dat moment op. Is het mogelijk het systeem op te starten via een livecd Hardy 8.04.1 en dan de aanpassingen te doen ook al is die livecd geen netbook remix? Ik hou wel van die netbook remix, gewoon al omdat hier eindelijk de draadloze verbinding out of the box werkt en dat was niet echt het geval met Hardy of Intrepid. Daar was het draadloos gebeuren op z'n minst wisselvallig te noemen.
Ik veronderstel ook dat die overschakeling naar ext2 moet gebeuren voor ik de andere aanpassingen doe zoals 'noatime' en dergelijke. (ik heb vandaag geen dvd-drive voorhanden dus die live-cd is niet te gebruiken nu)

Offline vanadium

  • Lid
Re: Ubuntu netbook remix- overschakelen op ext2
« Reactie #5 Gepost op: 2008/12/02, 23:55:49 »
Wijzigingen in /etc/fstab doe je in een editor. Als je wijzigingen doet aan de instellingen van je systeempartitie, dan herstart je het systeem zodat de systeempartitie met de nieuwe instellingen gemoutn wordt. Je let hierbij driedubbel op, want met een fout in je lijn start je systeem niet meer op.  Maak eerst een reservekopie van je huidige /etc/fstab die je, als het slecht gaat, vanuit een live sessie kan terugplaatsen.

Ik vind dat je nogal hard van stapel loopt. Ik heb duidelijk vermeld dat ik dit "vemoed". Dat houd in dat je zelf nog eens goed had moeten moet rondneuzen op internet of op ander advies wachten op dit forum voor je probeerde "ext3" in /etc/fstab te wijzigen in "ext2".

Nu heb ik met de zoekwoorden "convert ext3 ext2" deze FAQ gevonden, http://batleth.sapienti-sat.org/projects/FAQs/ext3-faq.html. Dit bevestigt wat ik zei: het volstaat de (goed afgesloten) ext3 geformatteerde schijf als ext2 te mounten.  Er staat ook hoe je (optioneel) de partitie kan "downgraden". Dat levert wat extra ruimtewinst op, maar als ik jou was, zou ik dat niet riskeren.