Installing Debian on a Fujitsu P-2110




[ Installing Debian | Patching the kernel | Setting up X | Setting up Sound | Power Management | Network, combo drive, and USB configuration | The Application Panel and LED | What doesn't work | Tips and Tricks | How I almost toasted my Linux install | Hard Drive Upgrade | How I set up my removable USB drive | Likes and Dislikes | Thanks and Links | How I set up my removable USB drive ]

P2110 Specs (borrowed from Fujitsu's site):

  • Processor: 867MHz Crusoe TM5800 processor
  • RAM: 256Mb, upgradable to 384 (reports of 512Mb RAM upgrade possible)
  • 10.6" wide-format SXGA TFT display, 1280x768
  • Video Card: ATI Rage Mobility-M1 8MB video RAM
  • Storage: 20Gb hard drive
  • Optical Drive: DVD/CD-RW combo drive (8x DVD/16X CD-R/24X CD)
  • Floppy: External USB Floppy disk drive
  • Audio: Sigma Tel AC 9757T 16bit
  • Built-in ports: 56K Modem, 10/100 RealTek RTL8139, headphones, mic, line out, IEEE 1394, 2 USB ports, Mini-VGA, S-Video, Type I or Type II CardBus slot, optional internal 802.11b
  • Dimensions: 10.6"(w) x 7"(d) x 1.59"(h)
  • Weight: 3.5lbs


P2120 Information

First, I should tell you that I don't have a P2120 personally, so all of the information I will give regarding the P2120 is second-hand at best. I have not personally tested it or confirmed that it works, but I will try my best to confirm that the P2120-specific information I detail here has some sort of consensus regarding its accuracy and appropriateness.

That having been said, whenever there is some important configuration information that differs between the P2110 and P2120, I plan to add a differently-colored box like you see here, with instructions specificially for the P2120. As I do this, please feel free to send me any corrections/improvements you might have.

Let's start with the P2120 hardware specs:

P2120 Specs:

  • Processor: 933MHz Crusoe TM5800 processor
  • RAM: 256Mb, upgradable to 384 (reports of 512Mb RAM upgrade possible)
  • 10.6" wide-format SXGA TFT display, 1280x768
  • Video Card: ATI Radeon Mobility 8MB video RAM
  • Storage: 30Gb or 40Gb hard drive
  • Optical Drive: DVD/CD-RW combo drive (8x DVD/16X CD-R/24X CD)
  • Floppy: Modular Floppy disk drive
  • Audio: Sigma Tel AC 9757T 16bit
  • Built-in ports: 56K Modem, 10/100 RealTek RTL8139, headphones, mic, line out, IEEE 1394, 2 USB 2.0 ports, Mini-VGA, S-Video, Type I or Type II CardBus slot, optional internal 802.11b
  • Dimensions: 10.6"(w) x 7"(d) x 1.59"(h)
  • Weight: 3.5lbs

Installing Debian

Okay, now that that is out of the way, how do we install Linux on this thing?

First thing I did was to search around the net for other people who might have installed Linux successfully on this machine. The most useful site was definitely this one for the P-2046. I also got some help from this site. The laptop came configured with ~18Gb set aside for Windows XP Home, with a 2Gb partition used for their DiskImage SE backup image. I backed up that image onto a spare hard drive, and then used the DiskImage program to resize that partition to 5Gb. I was planning on keeping some form of Windows on the drive, so I figured I would keep any videos or mp3s stored on that larger partition so both OSs could use them.

After resizing the drive, I used my Debian (well of course Debian) 3.0 XFS-enabled netinst CD. The most important thing is to pass the ide0=ata66 ide1=ata66 option when booting. After that you are presented with the basic debian installation screen. I ended up partitioning my hard drive thusly:

Update 11-26-2002: I have changed my partitioning scheme to allow for a suspend-to-disk partition. Here is the new partitioning scheme:

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1      1747  14032746    c  Win95 FAT32 (LBA)
/dev/hda2          1748      1811    514080   a0  IBM Thinkpad hibernation
/dev/hda3          1812      1873    498015   82  Linux swap
/dev/hda4          1874      2432   4490167+  83  Linux

I put XFS on /dev/hda4 and set it as my root partition, and created a partition of type "a0" for suspend-to-disk. You can read more on that in the Power Management section. I went through and made sure that my network card module was loaded (8139too module), I also had it load the trident module for my sound card. Then I went through the Debian install setting things up to my liking. I'll spare you the details.

This particular install set up my combo drive as a generic scsi device for me, so that was one step I didn't have to worry about. Otherwise you would want to make sure the ide-scsi module is loaded and possibly append hdc=scsi to your boot line. Speaking of the boot line, make sure that you continue to append ide0=ata66 ide1=ata66 at the boot prompt until you patch the kernel.


Patching the kernel

Speaking of patching the kernel, I found the ALI15X3 IDE patch for 2.4.18 to work with the 2.4.19 kernel I was building. This patch will fix the problems that require the extra ide options to be added at the boot prompt, and will also let you use DMA on your drives. The Trident Patch for 2.4.18 which apparently fixes problems with sound after suspending the machine, also works for 2.4.19. I also, of course, installed the XFS patch from SGI. You can see a copy of my .config here (which I borrowed heavily from here along with borrowing tons of other settings and advice). Note I enabled CONFIG_X86_CPUID and CONFIG_X86_MSR in the kernel so that I can use longrun. More on that later.

Update 12-29-2002: More detail on my patching procedure.

I decided to go into a bit more detail on how I set up patches for my kernel. The first thing I do is to create a directory in /usr/src called "patches-kernel-version" For the last kernel, for instance, it would be /usr/src/patches-2.4.20 Then I copy whatever patches I plan on applying to that kernel into that directory. This way I can keep track of the patches I applied to each kernel so I can be sure to find the appropriate patches for the next kernel I decide to build.

At this point, after copying all the relevant patches to /usr/src/patches-2.4.20, and unpacking the current kernel, and linking /usr/src/linux to it, I cd into /usr/src/linux, and for each patch do the following:

greenfly@clover:/usr/src/linux$ patch -p1 < /usr/src/patches-2.4.20/alim15x3.patch_2.4.18.txt

If you want to test a patch out before actually applying it, add the --dry-run argument, which will test but not apply the patch. Note that the previous patch said 2.4.18 in its name. That is because I found that the patch applied just as well to 2.4.20, so I didn't go out and find any updated patch, but I still copied it to my patches-2.4.20 directory so I would know that I applied that particular patch to the kernel.


Update 11-11-2002: I found a patch to allow cpuid and msr in the 2.4.19 kernel.

I ended up enabling devfs in my kernel, but by default it won't create the /dev/cpu/0/cpuid and msr devices. I found a patch for 2.4.19 originally posted to the Linux Kernel Mailing List. I applied this and the devices showed up properly. I did, however need to modify my device permissions for longrun to work. I did this by editing the /etc/devfs/perms file and made sure these lines were present:

REGISTER ^cpu/[0-9]+$		PERMISSIONS root.crusoe 0775
REGISTER ^cpu/[0-9]+/[a-z][^/]*$		PERMISSIONS root.crusoe 0775
REGISTER ^cpu/[a-z][^/]*$	PERMISSIONS root.crusoe 0660
The middle line is one I created so that the cpuid and msr devices would get proper permissions. I then ran /etc/init.d/devfsd restart to accept the changes. Now longrun works fine under devfs!

Update 12-03-2002: Upgraded to 2.4.20

I went a slightly different route with this kernel and used Debian's make-kpkg program to build everything. I accumulated the debian lm-sensors, alsa, and hostap sources and extracted them, which puts them in /usr/src/modules. At that point I applied the xfs, ali15x3, and devfs_cpuid patches that I mention further up, and then ran make-kpkg --rev alim15x3+devfs.cpuid.1 kernel-image modules_clean modules-image to build everything. I am now using the ALSA snd-ali5451 module instead of the trident module included in the 2.4.20 kernel. The .config is basically the same but you can check it out here (Updated 03-12-2003: I just got an orinoco card, so I compiled in all the wireless modules into this kernel).

P2120 Specific Information

Okay, since the P2120 doesn't support APM, but only APCI, and since APCI on the 2.4 kernel series is somewhat iffy, there are some different steps you must take. First step is to get the latest ACPI patch for the 2.4 kernel from acpi.sourceforge.net. The latest patch for 2.4.20 can be found here.

If you are feeling adventurous, you can try the latest 2.4 prepatch, with right now is at 2.4.21-pre5 and can be found here and patch the resulting kernel tree with the latest pre-5 ACPI patch.

If you are feeling even more adventurous, you can try the latest 2.5 development kernel release. ACPI is under very active development there. The 2.5 version numbers increment so often, I'm not about to try to keep up with it. Just check http://www.kernel.org/ to get the very latest 2.5 kernel release.

Once your kernel is extracted and patched check your kernel config and make sure that in addition to configuration I have outlined above, that your ACPI support is enabled along with USB2 support. "Spoon" from the leog.net forum has offered his kernel config for his P2120.


Setting up X

Next up is to set up X. The main thing you need to know is to add the following modeline so you can acheive the 1280x768 resolution:
ModeLine "1280x768" 81.59 1280 1280 1384 1688 768 769 774 791
Actually, it might be easier if you just take a look at my current
XF86Config-4 file. I'm in the process of adding a screen section so I can start a screen for TV-Out.

Update 12-27-2002: More detail on building DRI-XV packages from retinalburn.net

To get DRI, XV, and GL working under X, I ended up grabbing the patched drivers from http://www.retinalburn.net/linux/. Follow his directions for details, but the following is what I did. First, I downloaded two files, mach64-20020920-linux.i386.tar.bz2, and mach64-dri-xv-20020916.tar.bz2 from his site. Go here for updated files. I then untarred the first file, which unpacks into a directory called "dripkg". Then I went into that directory and ran the install.sh script inside. Note that you will need to have the source for whatever kernel you happen to be using. This script will build and install the mach64 dri modules for your kernel. After I did this, I unpacked the second mach64-dri-xv file, which unpacks into a X11R6-DRI directory. I then made a backup copy of my /usr/X11R6 directory, just in case, and then went into the X11R6-DRI directory and typed as root:

greenfly@clover:~/X11R6-DRI$ cp lib/modules/drivers/* /usr/X11R6/lib/modules/drivers/ 
and
greenfly@clover:~/X11R6-DRI$ cp lib/modules/multimedia/* /usr/X11R6/lib/modules/multimedia/
At this point I restarted X, and xvinfo worked, and xine and mplayer both worked with xv acceleration.

For GL to work, you will want to make sure that the only GL libs that exist on your system are under /usr/X11R6. Also, I've noticed that DRI won't work above 16bit color depth. The /var/log/XFree86.0.log complains about needing 9Mb+ of video memory to run at 24bit color depth. I would rather have more colors than GL acceleration at the moment, so I'm running at 24bit, with plans to set up an additional screen section in my XF86Config-4 so I can start a new 16bit X session for games. Without GL acceleration, glxgears pulls between 100 and 120fps, with GL it gets around 220 to 240fps.

I got tvout working to some degree by using atitvout which happens to have a package for Debian Sid. It isn't perfect, but it will work as long as you specify to display on the TV only. I haven't been able to get a simultaneous view yet, so I use atitvout t and then run atitvout l to switch back to the laptop screen.

P2120 Specific Information

Because the P2120 uses the Radeon Mobility instead of the Rage Mobility, the accelerated drivers from retinalburn.net will not work for the radeon. However, it appears that X 4.3 has support for PCI Radeon cards. Simply specify "radeon" as your driver instead of "ati".

An additional note for debian woody users (Added 04-09-2003):

I received a tip from Aaron Enright, a P2120 user, on getting a working version of X for the P2120 with Debian Woody "the Debian way." Simply add
deb http://people.debian.org/~blade/woody/i386/ ./
to your sources.list and run apt-get update && apt-get upgrade to get a version of X that works on woody, without having to resort to installing the X binaries from their site.

A experimental source for X 4.3 for sid users (Added 2003-11-04):

That above source doesn't help you much if you are a sid user, so here's the experimental X source for debian: deb ftp://ftp.debian.org/debian/ ../project/experimental main contrib non-free

Then run apt-get update && apt-get -uft experimental install x-window-system-core


Setting up Sound

(Added 05-29-2003)

I have just about enough information on setting up sound, for it to warrant its own section. As far as I know, all the sound features of the P work under Linux, including the digital out, which I will cover below.

Setting up Alsa

Now, while you can make due with the trident kernel module, I've had the best results (and best compatibility) with the ALSA sound drivers. The first step is to get the alsa source for your distribution. If you are using a distribution's pre-packaged kernel source, you might already have alsa modules built for you. In that case, just install that package and skip on to the next steap. Otherwise, download the alsa modules source code, or, if you are on debian, apt-get install alsa-source (which will put the modules in /usr/src/modules/apt-driver). If you are using make-kpkg under debian, make modules will build the source inside /usr/src/modules for you and create a .deb from it. Otherwise, go into your alsa module directory, and follow the instructions in the INSTALL file, which tells you to make sure you have sound support compiled into your kernel, then run ./configure and then make install.

At this point, your alsa modules are built and installed on your system. Now for the configuration. The main alsa driver that corresponds with the P is the snd-ali5451 module. If you simply modprobe that, you will have sound working for all of your alsa-supporting applications. If you have older applications such as older games, that require OSS sound support (or you want to use an OSS sound mixer for basic settings), then you also should load the snd-pcm-oss, snd-mixer-oss, and snd-seq-oss modules. I have all four of these in my /etc/modules file so that they load on boot. At this time you will probably want to install some sort of alsa-supporting mixer, such as alsamixer. In Debian you can get that by installing the alsa-utils package.

Digital Out

I have also tested and confirmed that the digital out port on the back of the P works! Here's how. Once you have alsa set up and sound working on your system, run alsamixer. Go over to the component called "IEC958" and make sure it isn't muted (under alsamixer it will show 2 Ms at the top for that component, and you can unmute it by pressing 'm'). After that, go over to the "IEC958 Playback AC97-SPSA" component and make sure that it is down to 0%. I tested this out, and it seemed that I would only get sound output out of the digital out when it was at 0%. Whenever, I tried any other setting, it would no longer work. At this point, simply plug in a mini digital plug into the line out on your P, and go!


Power Management

For power management, I installed the apmd Debian packages. There is one caveat though. I noticed that after a suspend, X would be fine but any consoles wouldn't come back up. Some people offered modifying the /etc/apm/apmd_proxy script so that it says "return 0" instead of "exit 0" at the end. That seems to work, although I am still losing console sometimes. I also installed the longrun Debian package, which was nice enough to create the devices under /dev for me. I haven't been able to get the gkrellm longrun plugin to work, but longrun itself works fine. I set up a "longrun" group and gave it write access to those devices. I modified a hdparm apm script to set up my economy mode under longrun. You can check that out here. I have it currently set up to allow speeds between 300Mhz and 667Mhz when on the battery, and the full 867Mhz when plugged in. I also downloaded a nifty dockapp to monitor longrun status called wmlongrun.

Update 05-11-2003: Enabling LongRun Thermal Extensions (LTX):

Another Crusoe user, WildBill, gave me a tip on how to enable Longrun Thermal Extensions in Linux. It's very straightforward. Basically, to enable it you run /sbin/setpci -v -s 0:0.0 a8.b=11 and to disable it you run /sbin/setpci -v -s 0:0.0 a8.b=0e. Once you do this, you can check if it worked by running longrun -p. When enabled, you will see the following:

clover:/home/greenfly# longrun -p
LongRun: enabled
LongRun Thermal Extensions (LTX): active
LTX setting: reserved
Current performance window: 100 to 100
Current performance level: 100
LongRun flags: performance
You might be wondering, what is LTX in the first place? Here's the description from Transmeta's site on Longrun:

Thermal Management

The management of how a device will dispose of heat is an integral part of microprocessor design. Operating temperature rises as heat collects in a device, potentially causing damage and affecting performance. Designers are careful to incorporate thermal solutions in their designs that allow their products to operate within a safe temperature range. Conventional processors typically use Thermal Throttling for CPU thermal management. Thermal throttling regulates the thermal environment by alternating between running the processor at full speed and placing the processor in a sleep state whenever the upper limits of the thermal envelope are reached. Performance is delivered in discrete bursts that tend to be unfavorable for applications processing smooth multimedia content, such as software DVD and MP3 playback.

By integrating a thermal model into the software algorithm, LongRun manages the Crusoe processor's thermal environment by using frequency/voltage shifts as a substitute for thermal throttling. In contrast to conventional thermal management techniques, the LongRun thermal extensions deliver higher performance at the same die temperature or the same performance at a lower die temperature, essentially expanding the thermal budget of the CPU. The LongRun thermal extensions allow the possible elimination of active cooling solutions, which reduces system weight and time-to-market as there is no need for explicit CPU thermal management.

With LongRun, Transmeta delivers superior performance for a given thermal envelope.

Well, that was a nice bit of PR-speech. Anyway, I added the enable and disable commands to my longrun apm script.

Update 05-13-2003: Well, that didn't exactly work as planned. I figured that the laptop would get warmest during performance mode, so I enabled thermal extensions during that time, but it really slowed things down. I got an email from dirk, complaining about poor video performance, so I ended up swapping the thermal extensions to only be enabled when on battery power. I actually decided to just leave those commented out, and those of you that wish to use it can simply comment the lines back in.

Update 11-26-2002: I have gotten suspend-to-disk working. Here's how:

First you need to make sure that you have created a partition of type a0 (IBM Thinkpad Hibernation) on your disk. The partition size should be equal to physical RAM + video memory + 2MB, or 266MB in my case. I set it higher, because I wanted to allow room to grow up to 512MB RAM. Next I downloaded lphdisk using apt-get install lphdisk. You need to use this utility to format that partition so that the BIOS can recognize it. I just ran lphdisk and it found my previously-created partition and formatted it for me. Then I rebooted and set my BIOS to suspend to disk rather than memory. After I booted back into Linux, I hit the power button and also tried apm -s, and both suspended to disk properly. You will see a screen pop up which shows the data being copied to disk, and then the machine will power down completely, no lcds flashing or anything. If you want to suspend to RAM you can either set that up as the default in your BIOS, or run apm -S.

My plan is to try turning off automatic suspend when the panel is closed in the BIOS, and try to set up APM to recognize that event and run apm -S instead of apm -s. Otherwise, if you suspend to RAM and then close the panel, it will go ahead and automatically suspend to disk, which isn't what I would like it to do.


Update 02-22-2003: I have gotten combo drive/modular battery swapping working! Here's how:

Yooden from the Leog.net P-2000 Linux forum pointed out in a thread that you can hotswap out the combo drive with the modular battery by simply doing a warm swap instead (swapping out while your machine is suspended). I just tried it out and it works great. The only question I might have now is whether it'll work if the combo drive isn't in the laptop when it originally boots. I will try that out at some point and update this. Even so, it doesn't matter much since I won't be rebooting this machine much at all! Thanks Yooden!

P2120 Specific Information

Todo: Add ACPI configuration information. In the meantime there are multiple documents, including ACPI's own internal documentation, for instructions on how to use the system. Note that APM no longer works for the P2120 series.


Network, combo drive, and USB configuration

The RealTek 8139 network card on the laptop uses the 8139too kernel module, and accepts MII commands, so I was able to get it to work with the laptop-net package with some tweaking. Here is my /usr/share/laptop-net/link-change file that I modified (Updated 11-14-2002). Basically it didn't maintain an eth0 device when you unplugged the cable so I had to tweak it to keep something running so it could pick up the MII cable connect event properly. Now, it detects when I have unplugged the network cable and disabled the eth0 device accordingly. This package also detects what network you are connected to and can configure your machine accordingly.

The CDR, configured as a scsi device, works well using cdrecord and gcombust. I added some lines to my sources.list and downloaded mplayer, xine, and dvdread, dvdcss, and other related packages and DVD playback works great, especially since the screen has a 16:9 aspect ratio, which works great for widescreen movies.

I haven't tested USB much or IEEE 1394 yet, but from other sites they apparently works fine. The USB floppy works by loading the usb-storage module. You will also need scsi_mod, sg, sr_mod, and usb-ohci (you need that last one for USB in general). It shows up as a NEC Model: USB UF000x Rev: 1.21 under /dev/sda. The very first floppy I used, however, got stuck in there! I managed to remove it, but now it doesn't seem to be able to read any other floppies correctly. I might have to contact Fujitsu about this one. Update 11-19-2002 I got my replacement floppy 3 days after I called in an RMA. Fujitsu was really responsive and helpful, and the new one seems to work fine. All that is left is for me to ship back the defective drive. So, so far, I've had good results with Fujitsu support, which makes me feel pretty good.


The Application Panel and LED

Update 11-14-2002

With some help, and patched code from Javier on the Fujitsu P-Series Forum, I have been able to get all three application panel buttons working, as well as the mail indicator LED (which, wasn't as impressive as I was expecting, I thought the whole blue side panel would glow, oh well). So anyway, here's what I did:

Installing lm-sensors:

First I installed lm-sensors. I'm not going to get into this a whole lot, because there are other sites that go into how to install this package, and it differs across distros anyway. For my system I did apt-get install lm-sensors lm-sensors-source and then went into /usr/src and extracted the lm-sensors source it put there. I then followed the instructions and compiled and installed it and ran sensors-detect, and after it found the appropriate modules, and I loaded them, sensors reported a few various settings, all at 0%. If you are curious, sensors detect told me to append the follow lines to my /etc/modules file:

# I2C adapter drivers
i2c-ali1535
# I2C chip drivers
adm1021
It also instructed me to put the following in my /etc/modutils/local file, and run /etc/init.d/modutils restart:
# I2C module options
alias char-major-89 i2c-dev
options adm1021 ignore=0,0x19

Installing apanel:

Next is to install the apanel software. First you extract the file and go into the extracted directory and run make all which will compile the software. At that point you copy fjkeyinf.o into your /lib/modules/<kernel-version>/misc/ directory (the lm-sensors install should have created this directory for you) and run depmod -a. At this point my system complained of unresolved symbols, because the source for some reason was built for kernel version 2.4.19, but mine had an extended version, 2.4.19-xfs-devfs. All this meant was that I needed to use insmod -f /lib/modules/<kernel-version>/misc/fjkeyinf.o instead of using modprobe. Then you copy fjkeyd into /usr/sbin, and apanelc into /usr/bin.

There is an included init.d script called rc.fjkeyd that I copied into /etc/init.d/fjkeyd and then I ran Debian's update-rc.d fjkeyd defaults which created all the appropriate symlinks in my various runlevels. Now you will want to create an /etc/fjkeyd.conf file. This file should only contain four lines, and those four lines will correspond to the A, B, Internet, and Mail buttons respectively (The P doesn't have an Internet button but other Fujitsu models do). In each of these lines, the first entry will be the command to run, and all following entries are considered arguments to that command. Now note, each entry needs to be tab-separated or it won't read it properly. I found it most useful to write a simple shell script containing the command I wanted to run, and then simply put the path to that shell script for the line. That way I don't have to worry about separating all the arguments with tabs. Each time you change the /etc/fjkeyd.conf file, you will need to restart /usr/sbin/fjkeyd, which you can either do manually, or by running /etc/init.d/fjkeyd restart. One thing I made sure to do, was to specify the display to execute the command on, when I was running an X program, just in case the DISPLAY environment variable wasn't set where that script was run. Here's an example /etc/fjkeyd.conf:

xterm	-display	:0.0
rxvt	-display	:0.0
xterm	-display	:0.0
mailterm
Note that it doesn't really matter what you put in the third line, since the P-Series doesn't have an internet button, but you do need something in there as a placeholder.

Because of the fact that modprobe didn't work, I had to modify /etc/init.d/fjkeyd so that it ran insmod -f instead. Also, you need to create a /dev/fujitsu/apanel device with Major number 10 and Minor number 216. I use devfs, so I added the following information to my /etc/devfsd/devices file:

fujitsu         d       ""      ""      root    root    0755
fujitsu/apanel  c       10      216     root    root    0666
and restarted devfsd. Now at this point it complained that /dev/fujitsu/apanel did not exist, even though ls told otherwise. The reason, apparently, is that you don't want the adm1021 driver loaded along with fjkeyinf. So comment out (or remove) that line in your /etc/modules file, unload that module, and then run /etc/modutils restart.

With all the appropriate modules loaded, including fjkeyinf, I ran apanelc, and it gave me its usage information. It works! I then ran apanelc led on and the led on the side turned on. Then I pressed A, B, and Mail, and the programs I specified (xterms to start) popped up!


Updated 02-16-2003 Special instructions for P2040 users:

A helpful post appeared in this thread in the leog.net Linux forum regarding getting fjkeyinf to work on the P2040. I'll just repost tnhh's post here:

tnhh:

After a bit of experimentation, I managed to get it working on my P2040 running Gentoo. The BIOS address is slightly different, so you need to patch fjkeyinf.c:


diff -Naur apanel-linux-0.9.orig/fjkeyinf.c apanel-linux-0.9/fjkeyinf.c
--- apanel-linux-0.9.orig/fjkeyinf.c    2002-10-29 16:33:29.000000000 -0500
+++ apanel-linux-0.9/fjkeyinf.c 2003-02-16 07:29:24.000000000 -0500
@@ -198,7 +198,7 @@
                           smbus device         0x30}; */
			    
 /* Highest one should be first */
-static unsigned fjkeyinf_addr[] = { 0x000FFA30, 0x000F6F70, 0 };
+static unsigned fjkeyinf_addr[] = { 0x000FFA30, 0x000F6F80, 0x000F6F70, 0 };
     
 /*
  * the following functions implement the ioctls. Note however, that not


Here is an email from Javier describing some extra features of the fjkeyinf module:

Just a few comments (from your web page). The daemon defines several
enviroment variables that may be useful:

KD_SHIFT has a number with the shift state when the button is pressed (so  
you can do a ctrl+alt+A, for example).

KD_MODE is a text string. Either "TEXT" or "GRAPHICS" depending of the
status of the current console when the button is pressed.

KD_UID and KD_USER have the numeric and text user that has the ownership
of the current console.

This is an example of one script:
--------------------------------------------------------------------
#!/bin/sh
if [ "$KD_SHIFT" == "12" ] ; then
exec init 6
elif [ "$KD_SHIFT" == "1" ] ; then
exec init 4
fi
if [ "$KD_MODE" == "GRAPHICS" ] ; then
if [ ! -z "$KD_USER" ] ; then
echo 'exec /opt/kde/bin/kcalc -display :0' | exec su $KD_USER
fi
else
echo  Key B
fi
--------------------------------------------------------------------

Javier Achirica


What doesn't work

The internal software modem is the only device that doesn't yet work as far as I know. So far there haven't been any drivers yet for the internal software modem although this page gives me hope.

I'd also like to get the screen to automatically dim on battery power so I don't have to hit the Fn keys.

Updated 02-22-2003 Status of IDE hotswap:

I have gotten IDE hotswap working by warm swapping it. Check out that section under Power Management.


Tips and Tricks

New 02-04-2003

In this section, I will go over a few extra tips and tricks I have done to finish up setting up my P-2110.

apanel tweaks:

I have gotten the apanel set up just about the way that I want it, so I decided to post my configuration here. The first thing I did was to change the /etc/fjkeyd.conf file so that instead of specific utlities, it would run some shell scripts I wrote that decide what the appropriate action will be. That way, instead of having to modify /etc/fjkeyd.conf and restart /etc/init.d/fjkeyd whenever I wanted to change something, I would have specific scripts set up for each button and change those instead. As a result, my /etc/fjkeyd.conf script looks like this now:

apanel_a
apanel_b
xterm	-display	:0.0
apanel_mail

Note again that the third entry doesn't matter, this program is also designed for other Fujitsu models that have an extra button there. All the apanel entries correspond to shell scripts that I put in /usr/local/bin, named after the Application button pressed. Here are the links to each script, as well as a quick description of what each does:

apanel_a
This is my terminal button. When I press it by itself, it will run "eterm_main" which is simply another shell script I have set up that runs Eterm with various arguments. When I press it with the Shift key depressed, it runs another script that runs Eterm with a darker tint set (to make things like irc programs more readable).

apanel_b
This is my "movie" button. Pressing it by itself runs xine, my preferred video player. Pressing it with the Shift key depressed runs another script called "tv" which starts a new X session (by running yet another quick script called "tvout" as my "tv" user--an account I set up specifically for watching video on the TV (it loads with 16bit color depth and a 1024x768 screen). Once I am in the second "TV" X session, then I hit Ctrl and the B Application button, which runs the "toggle_tv" script. That script checks the current state of tvout, and toggles it accordingly.

apanel_mail
This button runs my mail application, which is mutt in my case. Then the script will turn my mail LED on. Pressing Shift along with it will run "offlineimap" which is a program I use to synchronize my local mail folders with my IMAP mail server (that way I can look at past email without being connected to the net).

Note that with each of these I am first echoing a string to "osd_cat" which is a program that displays whatever text you send it, on the screen (OSD=On Screen Display). That way, when I press the mail button, for instance, the mail LED lights, and "mail" appears at the bottom of my screen in bright green.


Blinking the LED for new mail

This sort of setup really is dependant upon your own system configuration, but I will post what I have done, and leave it up to each user to change it to fit their environment.

First, a bit about my local mail setup. I use offlineimap, which syncs a remote IMAP server with your local system. As a result, I have a local copy of my mail set up in maildir format. Instead of posting my scripts I will just describe what they do, since they are pretty specific to my setup. I have one script that checks my remote mailserver every minute for new mail. If new mail exists, the script runs "offlineimap" which then syncs up my laptop with the mail server. I have another script running that checks my local "new" mail directory for any files, and if files exist in there it runs apanelc led blink 100 which sets the mail LED to blink. Alternatively it checks to see if mutt is running and if so, it leaves the LED solid (with apanelc led on). Otherwise, it runs apanelc led off.

If you don't have a similar setup, but do have mail located on a remote system, I would recommend setting up fetchmail for your mailserver configuration (doing this is a bit beyond the scope of this document, but there are tons of docs out there, as well as a few GUI configuration tools for this), and then write a script that runs fetchmail -c however often you wish, and if new mail exists, then turns on the blinking LED. In Perl, for instance, a simplistic version of that script might look something like this:

#!/usr/bin/perl

# This script will check for new mail using fetchmail -c
# and set the apanel led to blink if new mail exists
# otherwise it will turn the led off.
# After that it sleeps for $seconds seconds and starts again

$seconds = 60; #seconds before repeating

while(1)
{
  $total_messages = 0;
  $seen_messages = 0;

  open FETCHMAIL, "fetchmail -c 2>/dev/null |";
  while(<FETCHMAIL>)
  {
    if(/(\d+) messages \((\d+) seen\)/)
    {
      $total_messages = $1;
      $seen_messages = $2;
      if($total_messags > $seen_messages)
      {
        system("apanelc led blink 100");
      }
      else
      {
        system("apanelc led off");
      }
    }
  }
  close FETCHMAIL;
  sleep $seconds;
}

Note that this script will just continue running forever until you kill it. On my version I also check to see if offlineimap is running, and if so I sleep for $seconds.


Changing wireless networks easily (Added 03-12-2003)

I recently got an orinoco gold pcmcia wireless card for my P, and took the opportunity to streamline my wireless configuration. To ease configuration, Debian has now made it possible to do all of your wireless configuration from withing /etc/network/interfaces. That, coupled with the "mapping" feature of ifupdown, lets you create multiple wireless schemes that you can control by setting your cardctl scheme. Here's what I did:

First, I copied the pcmcia-compat.sh script from /usr/share/doc/ifupdown/examples/ to /usr/local/bin and made it executable by running chmod a+x /usr/local/bin/pcmcia-compat.sh. This script is used in the interfaces mapping to determine what cardctl scheme is currently being used. You then add a special configuration entry to your /etc/network/interfaces file to tell it how to use this script:

mapping eth1
	script /usr/local/bin/pcmcia-compat.sh
	map home,*,*,*		home
	map work,*,*,*		work
	map ssu,*,*,*		ssu
	map linksys,*,*,*	linksys
	map any,*,*,*		any
	map adhoc,*,*,*		adhoc
Note that since I'm using an orinoco card, the device name is eth1. If you are using a prism2 based card (such as the internal wireless card in the P) you might be using wlan0 instead. Each map line here tells the script which cardctl scheme maps to which entry further down the file. For instance, if the cardctl scheme is "home" it will match the "home,*,*,*" line, which points down to my "home" configuration:
# home wireless
iface home inet dhcp
	up /usr/share/laptop-net/profile-change eth1
	down /usr/share/laptop-net/profile-change eth1 down
	wireless_mode	managed
	wireless_nick	clover
	wireless_essid	my_home_ssid
	wireless_key	"00:00:00:00:00:00:00:00:00:00:00:00:00"
	wireless_rate	auto
(The essids and keys have been changed to protect the innocent). Note that I say "iface home" instead of "iface eth1" here. The rest of the lines are just regular interfaces configuration, with the up and down lines telling ifupdown to run that script when the connection is brought up or down, respectively (By the way, that script tells laptop-net to refresh its settings based on the network it finds itself in. laptop-net itself is an apt-gettable debian package that allows you to automatically configure settings on your computer based on what network you have connected to -- very useful for a laptop). The rest of the settings simply configure various aspects of my home WEP wireless network.

I then add entries like the above for each different network that I might need to connect to. Now, when I go home, I just run cardctl scheme home and the wireless card will be set to connect there. When I am at work, I can just run cardctl scheme work and it will be automatically configured for work (I also have laptop-net configured so that when I plug in an ethernet cable, it will automatically set my cardctl scheme based on what network it finds itself in). As you can see, this greatly streamlines the process of handling multiple wireless configurations.

You can see an example of my full /etc/network/interfaces file here.


Enabling Pointer Tapping (Added 04-08-2003)

For quite a while I had heard from other P users about "pointer tapping" on their P. Pointer tapping basically senses pressure from pushing down on the pointing stick, and translates it into a mouse click. I had never experienced this working on the Windows side, so I never looked into it much on Linux. I figured that maybe the P2110 didn't have pointer tapping ability. Well, I finally looked into "Trackpoint Utilities" on the Windows side and noticed that pointer tapping wasn't enabled by default. I enabled it, and saw what the fuss was about -- it's quite a handy feature to be able to generate mouse clicks just by pressing that button down.

I decided now that I knew what it "felt like" on the Windows side that I should test it on the Linux side. Here's how:

First, get the latest version of Linux Trackpoint Utilities from http://www-hft.ee.tu-berlin.de/~strauman/tp4utils/. Follow the step-by-step instructions in the README which are pretty straightforward. Now once you have installed this, you might notice that your user doesn't seem to be able to run it. That is because by default (at least on my system) the user doesn't have read and write permissions to /dev/psaux (well under devfs /dev/misc/psaux). I fixed that by adding a group "mouse" by running groupadd mouse as root, and then editing /etc/group and adding my user to the end of the mouse line (it was at the end since it was the last group added). Then I edited my /etc/devfs/perms file so that the /dev/misc/psaux device had mouse as its group. After I restarted devfsd, mouse was in fact the group that owned /dev/misc/psaux.

Then I added tp4d to my ~/.xinitrc so that it would start up along with X. After this you can run xtp4 to get a graphical program that lets you tweak tp4d settings. So far it all seems to work fine. Yet another piece of P hardware that works under Linux!


How I set up my removable USB drive

New 01-19-2004

For my birthday this last year, I received a USB laptop drive enclosure. Once I upgraded my hard drive in my P2110, I had its 20Gb hard drive to use in it. I decided to set up a FAT32 partition on it, spanning the full 20Gb, and now have set up hotplug and autofs to automatically mount the usb drive when I insert and access it (and umount it when it's idle).

So, first thing, is for hotplug to be installed. In Debian it was as simple as running apt-get install hotplug. Hotplug isn't necessarily easy to configure, but following some tips on the 'net, I was able to figure it all out. The first step, is to plug in the USB drive, and scan through the logs to make sure it works. Hotplug recognized that it was a usb hard drive, and made sure my usb-storage module was already loaded.

Jan 19 15:46:27 clover kernel: hub.c: new USB device 00:02.0-1, assigned address 4
Jan 19 15:46:27 clover kernel: WARNING: USB Mass Storage data integrity not assured
Jan 19 15:46:27 clover kernel: USB Mass Storage device found at 4
Jan 19 15:46:31 clover usb.agent[10819]: kernel driver usb-storage already loaded

USB drives work as regular scsi hard drives as far as we are concerned (and requires sd_mod to be loaded). And we could just mount the device that is created (/dev/sda1 for me) and be done with it. I wanted it to automatically mount when I plugged it in, and umount when I unplugged it. To do this, first we need some information from /proc:

/proc/bus/usb/devices will show information about the various usb devices on the system. For instance, here is a snip from the file when my usb drive is plugged in:

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0702 Rev= 0.02
S:  Product=USB TO IDE
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 96mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Yeah, it's a lot of gibberish, but there's useful information in there for setting up hotplug. You can configure hotplug to do certain things when certain devices are plugged in. It already has its own scripts set to run when it detects generic usb-storage devices, but I wanted something specific. To do this, you need to edit the /etc/hotplug/usb.usermap file:

# usb.usermap file
# This is autogenerated by update-usb.usermap program
# Note: you may use /etc/hotplug/usb/*.usermap
# usb module         match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass 
#bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
usb-storage     0x00f   0x05e3  0x0702  0x00    0x00    0x00    0x00    0x00	0x00    0x00    0x00

In the line I added above, there are only 3 fields of interest, the match_flags, idVendor, and idProduct. I noticed from the usb.distmap file that the match_flags field for usb-storage was 0x00f. Now, the idVendor value I got from that /proc file I listed above. It says "Vendor=05e3" so I put in 0x05e3 in the second field. Likewise I took the "ProdID=0702" and put in 0x0702 in the idProduct field. The rest doesn't matter (the first three fields are enough to match this device) so I just put in 0x00 for those.

This line in usb.usermap tells hotplug to run the /etc/hotplug/usb/usb-storage script whenever it sees that this device is plugged in. That script can then load modules, or run other programs (including setting up programs to run when the drive is removed). I found some examples on the net and created my own that would automount the drive:

#!/bin/sh
case "$PRODUCT" in
   5e3/702/2) # FireXpress usb hard drive
   /bin/mount /mnt/usbdrive
# set up what to do when you remove the drive
   echo -e '#!/bin/sh\n/bin/umount /mnt/usbdrive' > $REMOVER
   chmod a+x $REMOVER
   ;;
esac

If you want to see what kind of enviroment variables are present when this script is run, you can insert a "set >> /tmp/settings" line above the case statement. Reading through that file, you can see what $PRODUCT is set to for your product. In my case it was set to "5e3/702/2". I then set up the case statement to mount this usbdrive when that device is actually plugged in (my fstab entry established the mounting of a /dev/sda1 vfat partition on /mnt/usbdrive). There is another environment variable, $REMOVER, that specifies the name of a script that is run after the device is removed. This script is empty by default, so I echoed in the umount command I wanted to use when I removed the drive.

I then ran chmod a+x /etc/hotplug/usb/usb-storage to make the script executable. Once I restarted the hotplug service with /etc/init.d/hotplug restart I then could plug in the drive and see that /mnt/usbdrive had been mounted by running df. When I unplugged the drive, the drive would then be umounted.

Now, there are some problems for this. Namely, the drive isn't being umounted until it is already removed. This could result in filesystem corruption over time. The solution is to use autofs to mount the device on demand, and then umount when idle.

First, I installed autofs with apt-get install autofs. Then I modified /etc/auto.master and added an entry for my removable drive:

# $Id: auto.master,v 1.2 1997/10/06 21:52:03 hpa Exp $
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(5).
/var/autofs/misc        /etc/auto.misc
/var/autofs/net         /etc/auto.net
/var/autofs/removable   /etc/auto.removable     --timeout=2

That last line tells autofs to mount any of the removable devices I will specify in /etc/auto.removable under /var/autofs/removable, and to umount them after 2 seconds of idling. I then created the /etc/auto.removable file:

usbdrive        -fstype=vfat,uid=1002,gid=1002,umask=002        :/dev/sda1

This file sets up a mount point which will end up being /var/autofs/removable/usbdrive, the mounting options to use, and which device to mount. Now, all of this happens outside of /etc/fstab, so I removed my entry for my usbdrive from /etc/fstab, and also removed the /mnt/usbdrive directory. I decided what I would do instead is have my hotplug script create a symlink to the autofs mountpoint when the drive is inserted, and remove the symlink when the drive is removed. That way, I will only deal with /mnt/usbdrive and not worry about any /var/autofs directories. The new and improved /etc/hotplug/usb/usb-storage is the following:

#!/bin/sh
case "$PRODUCT" in
   5e3/702/2) # FireXpress usb hard drive
   ln -s /var/autofs/removable/usbdrive /mnt/usbdrive
# set up what to do when you remove the drive
   echo -e '#!/bin/sh\nrm /mnt/usbdrive' > $REMOVER
   chmod a+x $REMOVER
   ;;
esac

Now, I can plug in my drive, and see that /mnt/usbdrive is created. After 2 seconds, autofs will umount the drive. You can monitor /var/log/syslog to watch this happening:

Jan 19 16:24:35 clover automount[14059]: mount(generic): calling mkdir_path /var/autofs/removable/usbdrive
Jan 19 16:24:35 clover automount[14059]: mount(generic): calling mount -t vfat -s -o uid=1002,gid=1002,umask=002 
/dev/sda1 /var/autofs/removable/usbdrive
Jan 19 16:24:36 clover automount[14059]: mount(generic): mounted /dev/sda1 type vfat 
on /var/autofs/removable/usbdrive
Jan 19 16:24:39 clover automount[14066]: running expiration on path 
/var/autofs/removable/usbdrive
Jan 19 16:24:39 clover automount[14066]: expired /var/autofs/removable/usbdrive 

As you can see, the drive unmounted seconds after the command finished, since it had been idling. It would now be safe to remove.

For the future, I am planning on setting up a similar system for my digital camera (which appears as a normal usb storage device as well) to not only automatically mount the camera, but also sync up any photos on it.


How I almost toasted my Linux install

New 03-17-2003

The other day I was attempting to transfer a large (>4gb) file across the network to my P. While I had been able to do so with another machine, when I tried to do it on the P I noticed it choked around the 2gb mark no matter whether I was ftping from a Windows or Linux machine. When I looked at it closer, while the network card seemed to be giving the error (and RealTek's aren't known for their robustness) I had a feeling that it was due to the fact that I was copying this to a fat32 partition mounted under Linux. When initally partitioning this drive I decided to give the majority of the space to Windows under a fat32 partition, and then use it to share music and video files with Linux so that in case I couldn't get TV-out working under Linux, I could still use it under Windows.

I decided recently that since I use Linux 99% of the time on this laptop, and since other than the modem, I can do everything I need without Windows, that it's silly for me to use the majority of the hard drive space for a Windows partition to share files on. Yesterday I decided to remedy this. The idea being to use Partition Magic to resize my Windows partition down to around 4gb (giving it an extra gig to grow) and moving the swap and suspend partitions forward (well deleting and recreating them really), and then using xfs_growfs to make my Linux partition grow to fill the remaining space. Piece of cake eh?

Moving and resizing partitions

Well, Partition Magic managed to resize the Windows partition properly, and I was able to delete and recreate the swap and suspend partitions immediately after it, leaving about 9gb of free space between my swap and my root linux partition. At this point I tried xfs_growfs / which did nothing. The documentation isn't very verbose -- it mostly lists options and treats xfs_growfs as straightforward. I did notice, however, that it mentioned the XFS partition you wish to grow, needing to have the free space after it.

To fix this, I created a new 9gb XFS partition out of the free space, and transferred my root directory to it. Now if you ask some people on the internet how to transfer a root directory to a new partition or drive, you will get various answers. Some people will tell you to use "cp -a" which might work fine for a home partition, but when you copy the whole root partition you have to deal with things such as /proc and /dev which don't exactly copy correctly. The solution that has worked for me on about 30 to 40 partition transfers (seriously) for various systems has been a find/cpio one-liner. I mounted my newly-created XFS partition under /mnt/temp and did the following:
find / -xdev -print0 | cpio -pa0V /mnt/temp
this will properly copy all files onto the new partition without incorrectly spanning partitions (ie, copying the contents of /mnt/temp into /mnt/temp/mnt/temp creating recursive directories forever). It prints a period (.) for each file copied so you get a sense of progress, and you can always compare the sizes of the partitions using df to see how things are going along. This process probably took a good hour or so, and after it completed I went into /mnt/temp/etc/fstab and changed the entry for my root partition to point to the new device, and then rebooted.

Since I use grub, all I had to do upon boot is to hit 'e' to edit the boot entry for Linux, and pointed it to the new device. If you use lilo you would need to change the entry in your lilo.conf and then run lilo again to update. Once I booted into the new partition and verified I was there, I used fdisk to remove the old partition from the MBR (Master Boot Record) and tried to run xfs_growfs. It still didn't seem to work. Frustrated, I figured maybe I needed to reboot for the partition information to update, and decided to re-run grub-install so that it would properly read its config information from the new partition. When I ran it, it complained about one of my partitions not showing up properly. Oops! I just removed that. I decided to just reboot so that the partition information would be updated, and then try again.

How to break grub, your MBR, and the rest of your system

Upon rebooting, grub reported an error since it couldn't find the config file on the old partition because I had just deleted it. No problem, I'll just try booting from my Knoppix CD using the linux install as the root disk and fix it. Well, Knoppix doesn't seem to accept the root= option at boot, so it just booted into itself. I then mounted my linux partition and ran grub-install --root-directory=/mnt/hda2 /dev/hda but it complained about stage1 not being valid. I chalked it up to perhaps there being a difference between the grub version I was using for my install, and the one on Knoppix. I decided to try the "old" way of installing grub, which was by dd-ing the image onto the MBR. I read up on the info page, and the only mention of this method was under installing on floppies. Like an idiot, I figured this would work only for my hard drive as well. I ran the two dd commands (which for your sake I won't post here) and then tried rebooting.

KABOOM

I was presented with a generic grub prompt, but I'm used to these so I just entered kernel (hd0,1)/boot/vmlinuz root=/dev/hda2 but it complained that the BIOS couldn't read beyond a certain sector. No matter, I would just boot into my LinuxCare Rescue disc directly onto the hard drive and try to install grub again the traditional way. When I booted, and the kernel tried to access my hard drive, I was fed constant error messages and saw that the ide bus was resetting constantly. Weird. I chalked it up to the old kernel on that cd and tried my Knoppix disc again. It booted but whenever I tried access the hard drive whatever program I used wouldn't start and I would get messages about the device resetting. Not good. At this point I thought either I had simply overwritten the first part of my first partition with my grub image dd, or all this heavy and unusual disc activity had somehow fried the hard drive. No matter what I tried to do, I couldn't seem to be able to access the hard drive. Things looked bleak, I figured my hard drive was toast at this point, and started thinking about the process of shipping it back to Fujitsu, if they'd even accept it.

First definite casualty -- Windows

So I figure as a last ditch effort, maybe I can try reinstalling Windows 2000 on the hard drive to test whether it was really fried, or just had a messed up partition table. I had to overwrite my old Windows install to test this out, but I figured it wasn't as crucial as my Linux install, so I went through with it, and Windows 2000 surprisingly was able to install (although it intially complained about the MBR being messed up, of course). I believe I even remember the exact size I resized the disc to, so the rest of the partitions weren't touched (even if I had been a bit off, the next partition was the suspend-to-disk one, which I could stand losing). Now that Windows booted, it was time to move on to try to recover Linux.

Why Knoppix rules

So, I boot into Knoppix, and sure enough it can read my hard drive again! Now, the partition information for my drives is still there, but the MBR is gone, so this is when the tool "gpart" comes in handy. Gpart (short for Guess Partition) goes through your disc and looks for indicators of common partition types beginning and ending, and tries to piece together a MBR out of that. When I ran it from Knoppix, it detected both my old and new root partitions! I recreated my MBR with it using gpart -W /dev/hda /dev/hda, and when I rebooted back into Knoppix, they showed up but couldn't mount. I noticed that there seemed to be a 4mb empty space between the partitions, so I fired up fdisk and recreated those partitions with it, and wrote it, which fixed that problem. One more reboot to be sure, and I was able to mount my partitions again and the data was still there!

Okay, so now to try to fix grub properly. With my partitions all in place, I was able to run grub-install and have it reinstall grub properly. When I booted, I was presented with my friendly old grub menu and was able to boot off my partition again. All the data was there and I was able to start up X with all my settings intact. Schwew! Close one!

Okay, back to what I set out to do

Okay. Now I still need to resize my root partition. I tried xfs_growfs / again but it still didn't seem to automatically resize. I read at some point about xfs_growfs being used for Logical Volume Management, and that you would first resize the LVM and then run xfs_growfs. So, I tried just resizing the partition boundaries using fdisk, and then running it. It seemed to work then, and I rebooted and sure enough, the filesystem booted fine and reported the correct size!

What an ordeal. I did end up losing my Windows 2000 installation, but as I don't use it much anyway, it's not a great loss -- I'll fix it at some point. In the meantime, I tried copying that large file again, and sure enough it copied fine. The lesson? Be careful messing with your Master Boot Record, even if you know what you are doing, but even if you screw it all up, Linux might still be able to save you.


Hard Drive Upgrade

New 01-02-2004

So, after owning the P2110 for a year, I decided it was time for a hard drive upgrade. I not only wanted to increase the hard drive capacity, but I also wanted to move from a 4200rpm drive to a 5400rpm drive. After shopping around, I decided on the Toshiba MK4019GAX.

Here are some specs:
Model#MK2018GAPMK4019GAX
Size20Gb40Gb
Rotation Speed4200rpm5400rpm
Cache2Mb16Mb
Seek Time13ms12ms

First, I followed the instructions on this site to remove my old hard drive. Having changed out hard drives in other laptops, it was rather straightforward.

Then I hooked up my old hard drive to my desktop computer with a 2.5" laptop adapter (you can get them either online or at a decently-stocked electronics/computer store). I then created a temporary mount point for the two partitions I was interested in transferring (my Windows and Linux partitions) and mounted them at /mnt/hdc1 and /mnt/hdc2 respectively.

I then cleared up some free space on my desktop and ran the same command I use to transfer any root system, once for each partition: cd /mnt/hdc2; time find ./ -xdev -print0 | cpio -pa0V /path/to/hdc2backup (You don't have to run time with this command, I just chose to do it so that I could later compare the time it took to copy 7gb on both hard drives). At this point, all the data for each partition I wanted to back up, was in its own directory on my desktop computer.

Then I halted the machine, hooked up my new hard drive, and booted back up. At this point I had to recreate the partitions one by one using fdisk. I created each filesystem one by one how I wanted them, and then, after I had written to the partition table, I created the appropriate filesystems on the Windows and the Linux drives using mkfs. I then mounted the Windows and Linux partitions where I had mounted them previously and did the following for each partition to copy the data back to the new drive: cd /path/to/hdc2backup; time find ./ -xdev -print0 | cpio -pa0V /mnt/hdc2 as you can see, it is the reverse of the command I used to copy the data off the first hard drive. As a comparison, here's the different times it took to copy data off the old drive, and onto the new drive:

  • Off the old drive:
    real    36m16.629s
    user    0m15.470s
    sys     3m28.190s
    
  • Onto the new drive:
    real    17m0.879s
    user    0m14.900s
    sys     3m43.720s
    

Once all the data had been copied, I powered down my desktop and installed the new hard drive into the P2110. I then booted off of a KNOPPIX cd so that I could run grub-install to place grub back on the MBR of this new hard drive. I booted the KNOPPIX disc, mounted the Linux root read/write with sudo mount -o rw /mnt/hda4 and then installed grub with grub-install --root-directory /mnt/hda4/ /dev/hda. I then rebooted to find that grub was up and running and booted into my Linux partitions without any problems.

Once I had booted, I ran a few diagnostics to test the differences in speed. Here are the hdparm benchmarks:

  • Old:
    clover:/home/greenfly# hdparm -tT /dev/hda
    
    /dev/hda:
     Timing buffer-cache reads:   552 MB in  2.01 seconds = 274.63 MB/sec
     Timing buffered disk reads:   58 MB in  3.04 seconds =  19.05 MB/sec
    clover:/home/greenfly# hdparm -tT /dev/hda
    
    /dev/hda:
     Timing buffer-cache reads:   548 MB in  2.00 seconds = 274.00 MB/sec
     Timing buffered disk reads:   66 MB in  3.04 seconds =  21.71 MB/sec
    
    
  • New:
    clover:/home/greenfly# hdparm -tT /dev/hda
    
    /dev/hda:
     Timing buffer-cache reads:   544 MB in  2.00 seconds = 272.68 MB/sec
     Timing buffered disk reads:   74 MB in  3.06 seconds =  24.14 MB/sec
    clover:/home/greenfly# hdparm -tT /dev/hda
    
    /dev/hda:
     Timing buffer-cache reads:   564 MB in  2.01 seconds = 280.60 MB/sec
     Timing buffered disk reads:   74 MB in  3.02 seconds =  25.12 MB/sec
    
    

Likes and Dislikes

Likes:

To start off, let me say that I really like this laptop. My last laptop was a Toshiba Libretto 50CT, which is really small, and I was looking at getting a Sony Picturebook as an upgrade. This laptop is a bit larger than the Picturebook, but I think the little extra space is made up for with the included combo drive and other extra features. It is still small enough that I can fit it in a small Sony PSOne case I found at Target for $15. Plus, I don't have to worry about lugging around a ton of external devices and finding a place for them on my lap when on the road. The screen is nice and bright, the keyboard is decent to type on, much better than my Libretto.

Dislikes:

A lot of people complain about the right shift key on the Fujitsu P-2000 series. Personally I don't use that shift key a whole lot so I can overlook that, but what I haven't heard people mention much is how the left windows and ctrl keys are shifted over. I find myself hitting the Fn key a lot when I'm trying to do a ctrl key sequence. It would also be nice to have maybe an extra Fn key on the right side somewhere, so I can do things like pgup and pgdown without needing both hands. The battery on the front ends up serving as a wrist rest, but it seems to flex a bit under the weight. Everything seems to be okay and it seems to be attached firmly, but that little bit of flex just worries me for long term use. The speakers aren't great, but I don't expect to have awesome speakers on a laptop, and I use my headphones most of the time anyway. These are nit picks though, the laptop looks nice, is nice and small, and runs fast enough for my uses.

Future Upgrades:

I get 2 to 2 1/2 hours on the regular battery, depending on use and screen brightness. I'm hoping to get an extended battery at some point, and also an 802.11b card for it, as this model didn't have the integrated card. Other than that, at this time I can't really think of anything extra this laptop doesn't have.

Update 12-29-2002: Got a modular battery for Christmas!

My wife bought a modular battery for my laptop for Christmas. From some tests it seems I get between 5 1/2 and 7 hours of battery life depending on my screen brightness and whether I'm using a power-hungry PCMCIA card. I've noticed that the batteries last extremely long when using it with tvout.


Thanks and Links

Thanks definitely need to go to Todd Coffey for his very informative site detailing his Fujitsu P-2046 Debian install. Here are a few other useful sites:

Some relevant configuration files:

If you have any questions or comments, you can email me at greenfly@greenfly.org

page created November 10, 2002 | last updated January 21, 2004