Jaunty, ext4, startup times, ati driver 6
I started installing Jaunty on my computers 2 weeks ago. The first one to get the honor was a new Acer Aspire One. For this one as for the other ones, the install went flawlessly:
- the installer shrunk the windows partition automatically
- wireless was working after install (except on the all Aspire One with the Atheros interface. Not resolved yet because of lack of time but it appears a solution exists: https://bugs.launchpad.net/ubuntu/+bug/350352)
- graphics with 3D compiz effects were all working now using the 180.44 driver that got installed seamlessly.
After the initial install, I had some troubles...
Troubles with Ext 4
No trouble with ext4 on the new AA1, the conversion worked, nothing to complain about.
It was a very different story on a Dell laptop of mine. The conversion to ext4 succeeded there too, the machine rebooted fine after the conversion, but then I read a post about the need to append "rootfstype=ext4" to the kernel line in /boot/grub/menu.lst. I decided to go for it. Big mistake.
Now, that was a really stupid idea. I can't say for sure that's what broke it but in any case, the machine would not reboot after that, it would only go to grub console.
I tried reinstalling grub several times:
- boot with a live CD (I used a Jaunty live USB pen that I had)
- go to the grub prompt by simply typing "grub"
- root (hd0, 5)
- setup (hd0)
That rewrites the MBR with a brand new grub (supposedly supporting ext4 since it's 9.04). That didn't help. It wouldn't go past the grub console on startup. No error message is shown. The console sees the partitions, it even sees the files on the partition I want to boot from but it would not boot from it. Trying to 'cat' a file from grub shows only garbage.
I also tried to repair the partition table just in case (using systemrescuecd and Test-Disk). Nothing would help.
Fortunately, when booting from a live CD, I was able to mount the partition where I had my home directory so I could back it all up. I finally resolved to reinstall the system entirely with a full disk repartitioning and reformatting and I restored the home directory from the backup. That all went fine. I had lost a crazy amount of time on that issue though. So my recommendation is to not add that "rootfstype=ext4" to menu.lst. At best it will change nothing, at worst it's going to kill your installation.
Boot time
I measured the boot time before and after the upgrade and reinstallation on that Dell laptop. The startup time is measured between grub and the gdm login page:
- Intrepid: 52s
- Jaunty after upgrade still using ext3 on the main partition: 46s
- Jaunty after upgrade after the ext4 conversion: 46s
- Jaunty after full reinstall from scratch (using ext3): 36s
So, that's not quite what the hype tells us it is, it's merely an 11% boot time improvement from Intrepid to Jaunty and ext4 does not make any difference.
ATI, fglrx and xorg 1.6
Jaunty comes with xorg 1.6 and ATI has not released a unix driver yet that supports it. As a result, 9.04 does use the open source driver called just "ati" on machines using ATI video cards. I was a little reluctant to upgrade on an old desktop with an ATI card because of that. I'm not a Quake player but I didn't want to lose the compiz effects.
But it the end, this open source driver works wonders, the 3D effects appeared just as smooth as on intrepid and the CPU usage actually appeared lower while playing videos. I don't think I will swittch back to the ATI fglrx proprietary driver!
How to create an encrypted USB drive? 5
So you've got a shiny new USB drive, either a USB stick or a USB external drive. Typically it comes with a single vfat (fat32) partition. That's not too bad, it can be used (read and write) from both windows and linux and (although less secure that ext3) the vfat overhead is small compared to ext2 and ext3 leaving you more space for your own use.
But you want more: you want
- to store sensitive data in an encrypted partition on the drive
- to still be able to read and write to the disk on both linux an windows
- to have a smaller clear partition to be able to move regular files around without the hassle of having to enter the password to mount the drive
- I'll skip the TrueCrypt option which is not truly opensource to go directly to cryptsetup and cryptmount which are perfectly decent tools and that are truly free.
sudo su apt-get install cryptsetup cryptmount
Disk setup on Linux
You then need to partition the drive. To do that you can either use the command-line tool cfdisk or use the graphic partition editor in gnome (gparted). I personally used gparted as it's easier to use (System menu --> Administration --> Partition Editor). The USB drive will probably show up as /dev/sdb but be careful to verify which drive you are going to repartition as all data on that drive will be lost. There, I deleted the existing partition and created 2 new ones:
- the first one of type FAT32 and of size 10GB: this is going to be the unencrypted one
- the second one of type ext2 and of size 290GB (I could have used any kind of partition and using FAT32 here too would probably have saved me around 10GB)
cryptsetup will now take over and prepare the second partition for encryption:
# unmount the partition if needed > umount /dev/sdb2 # That creates the encrypted volume > cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb2 WARNING! ======== This will overwrite data on /dev/sdb2 irrevocably. Are you sure? (Type uppercase yes): YES Enter LUKS passphrase: Verify passphrase: Command successful.The default encryption mode was used (sha256 CBC), you can verify what it is by typing:
cryptsetup luksDump /dev/sdb2
Now you have a large encrypted volume but it's not ready for use yet, what you have is a raw unformatted partition in an encrypted volume written on top of formatted partition. You need to format that volume. I chose to format it from Ubuntu with gparted but that turned out to be the wrong choice. I formatted it as FAT32, it worked fine as long as I stayed on linux but, for an unknown reason, I couldn't read it on windows. Windows insisted the partition was not formatted.
Windows access
So the right approach seems to be to let windows format the partition as NTFS.
About windows, here is how to mount and access the drive. You need to download and setup FreeOTFE on your windows box.
- Plug in the drive
- start FreeOTFE
- File menu --> "Linux mount partition..."
- Select the encrypted partion and validate
- Enter the passworf you chose on linux side and validate The drive is now mounted, FreeOTFE has selected a letter and you can see it in the explorer. When you click on it, it might say the drive is not formatted yet and propose to format it. If you have no data to lose, say "Yes" and it formats the drive as NTFS.
Back on Ubuntu
Once you plugin the drive (now NTFS formatted) it should be attached automatically but obviously you need to enter the password. In Nautilus --> "Computer", the USB drive will show up with the label "XXX GB Media", double click on it, there you will be asked for the password. If successful, the drive immediately gets mounted to "/media/disk" and you're ready to use it.
For those of us who prefer the command line, a few tricks:
1) to find the device name, look at "/dev/sd*". /dev/sda is probably your primary disk, if you have no other disk, the USB drive will be /dev/sdb.
2) to attach the encrypted partition from the command-line:
> cryptsetup luksOpen /dev/sdb2 sdb2 Enter LUKS passphrase: key slot 0 unlocked. Command successful.
/dev/mapper/sdb2 gets created right then. Here, Ubuntu might mount the partition automatically (to /media/disk).
3) if it doesn't, you can mount it yourself:
> mount /dev/mapper/sdb2 /media/disk > mount | grep sdb /dev/mapper/sdb on /media/disk type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
That's it. Your files are now safe and you can move them around freely between Linux and Windows as long as you know the password.
To cleanly remove the drive:
> umount /media/clear-fat32 > umount /media/disk > cryptsetup luksClose sdb
Acknowledgment
Those 2 articles greatly helped me find my way around the problem:
Screen flickering with nvidia on ubuntu 27
Another nasty side effect of using compiz with an nvidia video card is the screen flickering. Right when a compiz 3D effect kicks in or 30 seconds after it, the screen goes black for a fraction of a second. This is not a new issue, I have struggled with it since hardy and it happens with all nvidia driver versions I can remember (173, 177 and 180).
Cause The cause the is the Powermizer feature of the nvidia driver. It adjusts the GPU speed depending on the usage that is being made of the desktop. Every time Powermizer decides to change the frequency, the screen flickers. You can easily verify that by going to the "Nvidia X Server Settings" panel, Powermizer. Watch the "Performance Levels" and see how the level changes every time the screen flickers.
Solutions There are many related posts on the web. The most common solution that gets reported is described for example at Linux Outlaws Forum. Add the following lines to /etc/modprobe.d/options:
options nvidia NVreg_RegistryDwords='PerfLevelSrc=0x2222' options nvidia NVreg_Mobile=1
It didn’t worked for me in Intreprid or older Ubuntu releases.
So the real solution that does completely works for me is to freeze the powermizer performance level to 0 through the "Nvidia X Server Settings" panel in the "Clock frequencies" pane. But that panel is only available after setting the "Coolbits" option in /etc/X11/xorg.conf in the screen section. For example, this is what I have:
Section "Screen"
Identifier 'Default Screen'
Device 'nVidia Corporation G72M [Quadro NVS 110M/GeForce Go 7300]'
Monitor 'Generic Monitor'
Option 'AddARGBVisuals' 'True'
Option 'NoLogo' 'True'
Option 'RenderAccel' 'True'
Option 'Coolbits' '1'
Option 'RegistryDwords' 'PowerMizerLevel=0x3'
Option 'AddARGBGLXVisuals' 'True'
DefaultDepth 24
SubSection 'Display'
Depth 24
Modes '1680x1050'
EndSubSection
EndSection
Then after restarting X, you can open the Nvidia setting panel and do the following:
- Go to "Clock frequencies"
- Check the "Enable Overclocking" box and accept the warning
- Select "3D clock frequencies" and pick a GPU and Memory frequency
- Apply
On my 7300 card, setting GPU to 100MHz and Memory to 400MHz works just fine, compiz 3D effects are still very smooth. Unfortunately, this needs to be done every time you restart X. If somebody finds a better solution, please let me know.
Update for Jaunty 9.04 and nvidia 180 (4/24/2009): in Jaunty with 180.44 and xorg 1.6, where the flickering is worst than ever, the solution above with /etc/modprobe.d/options actually works and no there is no need to lock the 3D clock frequency.
Nvidia driver and image corruption in Intrepid 1
Compiz is a must have on a Linux desktop. It brings the end user experience up to the MacOSX level. Unfortunately it sometimes comes with nasty side effects. On my Inspiron 6400 with a 7300 video card, it started misbehaving in Intrepid with driver 177. Window titles would either disappear or get painted with weird pink stripes. It happens only sometimes and only with a few applications. It may happen when the focus switches from one window to another or just when typing.
Thunderbird is the application where it happens the most. The definitive test is to start a new email and type the subject: the titlebar of that window will systematically get corrupted. It’s really ugly when it happens.
Nvidia driver version 177 is clearly the worst. Reverting to 173 improves things a bit but it still won’t pass the Thunderbird compose email test. You can easily switch to 173 by going to System/Administration/Hardware Drivers.
But today, as I was experimenting with the newest nvidia driver, 180.29, everything got fixed. Big thanks to Nvidia for fixing this!
How to setup the 180 driver in Ubuntu Intrepid Ibex?
I followed the instructions in Adam Michael Roach webpage. Basically, do the following: Append those 2 lines to /etc/apt/sources.list:deb http://ppa.launchpad.net/anders-kaseorg/ppa/ubuntu intrepid main deb-src http://ppa.launchpad.net/anders-kaseorg/ppa/ubuntu intrepid mainand run the following commands:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 026491A5DD081BDC6CDFC0DE6298AD34413576CB sudo apt-get update sudo apt-get install nvidia-glx-180Reboot and you’re done:
me@myhost ~ $ dmesg | grep -i nv [ 16.183016] nvidia: module license 'NVIDIA' taints kernel. [ 16.438964] nvidia 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 16.438974] nvidia 0000:01:00.0: setting latency timer to 64 [ 16.439174] NVRM: loading NVIDIA UNIX x86 Kernel Module 180.29 Wed Feb 4 23:44:25 PST 2009
