Answers 89

From LXF Wiki

Answers 89

<title>Recovering partitions</title>

<question>In my frustration at trying to get a new SATA drive to format, I accidentally formatted the wrong drive, which had three partitions (/, /home and swap). I must admit I was using the Windows XP install disk (last resort, honest!). I managed to press the reset button a few seconds in after failing to stop it with Esc or Ctrl+Alt+Del. The hard drive is of course unbootable now, but when I load up Knoppix and QtParted it still seems as if the /home partition is there (the desktop icon is present), although the other partitions have bitten the dust (unformatted space). If I try to get the partition (hda3) to mount by double-clicking on its icon on the Knoppix desktop, an error code says something like `filesystem not defined', which I suppose has something to do with the first chunk of hard drive having been formatted (is that where the `TOC' info is held?). Can you help? </question>

<answer>If you know the sizes of the partitions, you can create them again in Cfdisk. As long as you have not created any new filesystems in their place, the filesystems should still be on the disk ­ you have probably only deleted the partition table. It may take some trial and error to find the correct sizes for each partition, but as long as you mount each one read- only (add -o ro to the mount command) you can't make things worst. It is not surprising that you can no longer boot from the disk, as you have removed the root partition from the partition table, so Grub cannot find its files. There are a couple of utilities for automating the process: Gpart (not to be confused with GParted) and TestDisk. They are both on the Knoppix 5.0.1 CD and DVD. You should be aware that these programs are trying to guess your partition layout from leftover data; the Gpart man page sums it up nicely with, "It should be stressed that Gpart does a very heuristic job, never believe its output without any plausibility checks. It can be easily right in its guesswork but it can also be terribly wrong. You have been warned." Whichever program you try, read the man page thoroughly before you touch a byte of your disk, and be patient. Both programs take a long time to run, as they are scanning every sector of your hard disk, so an extra few minutes spent reading won't make much difference to the overall time taken, but could have a huge effect on the result. Incidentally, a TOC (table of contents) is used on CD and DVD filesystems. Hard disks have a partition table at the start of the disk, with the directory information contained in the filesystem itself. </answer>

<title>Locked out</title>

<question>When I try to log into my newly-installed Ubuntu I get a message saying: `Session only lasted 10 seconds'. When I check the log I see:

   `Failed to set permission 700 to .gnome2_private'.

I can only log in to a terminal, so how do I fix this? </question>

<answer>Are you reusing a home directory from another distro? What you describe is a classic symptom of that. Even though you may have used the same username as on your old system when installing Ubuntu, the username and group could have been allocated different numerical values (usually referred to as UID and GID). The filesystem only stores the numerical values, so these files are no longer owned by your user, hence the error when trying to change the attributes of one of them. Fortunately, the solution is simple and fairly quick. At the terminal prompt, type

sudo chown -R fred: ~fred

This resets everything in Fred's home directory to be owned by Fred. The string needs to be run as root, hence the use of sudo. The trailing colon after the username, which you will obviously replace with your own, is important ­ it sets the GID to whichever group Fred belongs to, his primary group. Not only is this quicker than running chgrp, it even saves you from having to look up the correct group. </answer>

<title>Double vision</title>

<question>I am using SimplyMepis 6.0. I have sound and internet, am pleased with apt-get, Beagle and SuperKaramba are working well ... the only thing missing is 3D acceleration. I installed the ATI drivers and activated them in the Mepis control centre. I also ran aticonfig, but the following is what I get from glxinfo:

root@1[philippe]# glxinfo | grep direct
_______________________________________
Xlib: extension "XFree86-DRI" missing on display
":0.0".
direct rendering: No
OpenGL renderer string: Mesa GLX Indirect

I have attached my xorg.conf file. </question>

<answer>Large configuration files, like the one you attached, can make it difficult to spot problems; a case of not being able to see the wood for the trees. Removing all the commented lines and sections made it easier to check and showed that you have two Device entries for your graphics card; one using the ATI drivers and one using VESA. This is normal, as are the duplicated Screen entries to go with them ­ it makes switching between the two setups as easy as changing one line in the ServerLayout section. However, this part of your configuration is definitely broken:

   `Section "ServerLayout"
   Screen 0 "ATIScreen" 0 0
   Screen 0 "aticonfig-Screen[0]" 0 0
   InputDevice "Keyboard0" "CoreKeyboard"
   InputDevice "PS/2 Mouse" "CorePointer"
   EndSection'  .

You have included two definitions for Screen 0 in ServerLayout. It would appear that X.org is using the first one, as this uses the VESA definition, but a quick check of the log file with

grep Screen /var/log/Xorg.0.log

will show you which screen is in use. All you need to do is comment out the incorrect Screen entry in ServerLayout and restart X to get your 3D acceleration working. You could remove the line, but by commenting it out, you can switch back to the VESA driver at any time by moving the comment to the other Screen line. </answer>

<title>Distro moving</title>

<question>I have a two-disk box with the hda holding Windows 98 SE, and SUSE 10.1 and Mepis 6.0 on hdb. I have decided to switch my main distro to Mepis. Everything is now installed on it and I want to ditch SUSE. However, I would really like to transfer Mepis 6.0 on to the primary drive. I am currently booting through SUSE's Grub, installed in the boot section of hda MBR, so as soon as I delete SUSE I will lose the ability to boot (but could solve this with the Live CD option). Is there an easy way, such as a total disk transfer, to copy Mepis as configured over to hda? I need to keep Win98, unfortunately. </question>

<answer>Grub is installed in the MBR, so it won't be deleted when you delete SUSE. You will lose the /boot/grub directory, which contains files needed by Grub, but you can replace that with the same from Mepis. The whole process is best done from a Live CD ­ you don't want to be messing with filesystems that the OS could be changing while you are copying them. Boot from the Mepis Live CD and log in as root, with password `root' Assuming that SUSE is on /dev/hda2 and Mepis on /dev/hdb1, do the following:

mount /dev/hda2
mount /dev/hdb1
cp -a /mnt/hda2/boot /mnt/hdb1/boot.suse

This mounts the filesystems and creates a backup copy of the SUSE boot directory, just in case you need it later. Now you can reformat the SUSE partition. You have a choice of filesystems to use here but if you are unsure use

mke2fs -j /dev/hda2

to create an ext3 filesystem. Now copy everything across with

rsync -ax /mnt/hdb1/ /mnt/hda2/

The trailing slashes are important! This process may take a while. When it has finished you need to edit /mnt/hda2/etc/fstab and change all the hdb references to suit the new locations on hda. You can reuse the SUSE swap partition on /dev/hda. The last step is to ensure your system boots correctly. If there was a /boot/grub directory on your Mepis disk, you need to edit the configuration file in /mnt/hda2/boot/grub/menu.lst to suit the new locations. Grub numbers disks and partitions from zero, so /dev/hda2 is (hd0,1) in Grubspeak. You may also need to add a menu entry to boot Windows, which you can copy from /mnt/hda2/boot.suse/grub/menu.lst. If there was no grub directory on your Mepis installation and you were handling everything from SUSE's bootloader, copy the grub directory from boot. suse into boot and edit menu.lst to add a suitable entry such as

title MEPIS at hda2, kernel 2.6.15-26-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda2
nomce quiet vga=791

The name of the kernel file should match whatever is in your boot directory. Finally, run Grub to make sure you are using the correct configuration:

grub
root (hd0,1)
setup (hd0)
quit

</answer>

<title>Windows killed my Linux</title>

<question>When I installed SUSE Linux Enterprise Desktop [SLED] 10, I made these partitions on my 28GB hard drive:

 FAT32, 10GB, /windows/C.
 Linux, 10GB, /.
 FAT32, 7GB, /windows/E.
 swap, 9GB, swap.

Then I installed Windows on C:. But now I have a problem: Linux is not booting. I do not get the menu that asks me to choose between the OSes; Windows starts directly. I should mention that when I was installing Windows it said something like, `there is an unknown partition, it will be inactive, if you want to activate it do...', but when I went to follow its instructions it couldn't recognise that partition and now I have Windows with only two partitions, C: and D: (note that D: is the 7GB, not the 10GB). Is there an answer? </question>

<answer>This is a common problem, caused by the Windows installer's assumption that there are no non-Microsoft operating systems. When you install Windows it overwrites the bootloader with its own, without considering that you may wish to keep it. The good news is that your Linux installation is untouched, including the original bootloader menu and other settings. All you have to do is reset the hard disk's Master Boot Record to use the Grub bootloader that SUSE set up for you. Boot from the SLED CD/DVD and select the Rescue System option from the menu; this will boot to a login prompt. Type root at the prompt (there's no password needed) and you are in a basic rescue shell. The first step is to determine which is your Linux partition. Run fdisk -l to display a list of partitions. One of them will be marked as Linux ­ probably /dev/hda2 based on your list of partitions above. You can mount this partition with

mount /dev/hda2 /mnt

Then type the following commands to enter the Grub shell and find the correct partition for the bootloader:

grub
find /boot/vmlinuz

This returns the boot disk in Grub's terminology, probably (hd0,1). Now type the following commands to set up the bootloader again:

root (hd0,1) #the disk label returned above
setup (hd0)
quit

That's it, you can now reboot with the cryptically-named reboot command. Eject the CD/DVD and you should get your Grub menu back with the same choices as before. Note that if you ever need to reinstall Windows, the same will happen again ­ with the same solution. </answer>

<title>Wireless Knoppix</title>

<question>Back in December 2005, you featured an excellent article on how to create your own distro [Build Your Own Distro, LXF74]. I have a problem with my laptop's wireless network card, an Intel ipw2200-based card (the PCMCIA version thereof). So what I was thinking of doing (using Knoppix 5.01) was to download the firmware for the Intel card, place it in /lib/firmware and remaster Knoppix with the firmware so that the card is recognised and configured, or at least configurable with a Live distro on booting up. I think that the drivers are built into the kernel for this card, but they cannot work without the firmware. I would really like to be able to use Knoppix as a Live distro, and get it to configure my wireless? </question>

<answer>This is certainly possible; when you are in the chroot environment described in Step 3 of the LXF74 article you can remove and install any files you wish, just as if you were running Knoppix natively. These changes will be committed to your new Live CD distro in Step 6. Knoppix already has the driver for this card in its kernel, but if you decide to rebuild the kernel make sure you include the CONFIG_IPW2200 option. Knoppix's hardware detection should pick up on the card, load the module, configure it for you and attempt to set up the wireless network interface using DHCP. If you want to run any specific commands at bootup, put them in a file called /etc/init.d/rc.local (this name is used by convention, but you can use any name you like) then activate it with

chmod 774 /etc/init.d/rc.local
ln -s ../init.d/rc.local /etc/rc5.d/S99local

Commands in the rc directories are executed in order, so the 99 in the name makes it start last. This is normally what you want, but if you need it to start before something else, lower the number (or raise the number of the other service). Don't be tempted to try to start the number too early. Bear in mind that you are working from a base system contained on a read-only disc, so it is almost impossible to mess things up. If your new Knoppix doesn't boot, step back and try again ­ you have nothing to lose. </answer>

<title>Nothing on TV</title>

<question>I have a home LAN of five PCs, one of which is set up without mouse, keyboard or monitor but has the TV-Out port connected via S-Video cable to an analogue TV. This PC has a digital HDTV card, and I have configured xorg.conf to clone the video card output to the TV. Everything works fine if I attach a mouse and keyboard because I can use the TV output instead of a monitor. Currently I can remotely access this PC using NX (preferable) or TightVNC, but I cannot figure out how to remotely access Desktop:0, which is the desktop being output to the TV. I have tried Google, but nothing that I have found seems to resolve this problem. I guess that an alternative solution may be to somehow set up xorg.conf to output Desktop:1 to the TV. I am currently running Kubuntu 6.10. </question>

<answer>VNC is intended to work like this, to run as a separate X session, although it is possible to change it. By running X11vnc, housed at www.karlrunge.com/x11vnc, you can make your existing X display available via VNC. But because you are using Kubuntu, and therefore the KDE desktop, the answer is simpler: use the Rdesktop server and client contained in KDE. On the headless PC, start the KDE Control Centre and go to the Internet & Network > Desktop Sharing section. Next, turn Allow Uninvited Connections on and Confirm Uninvited Connections off. You must set a password to stop unauthorised connections. Blocking port 5900 at your router is also a good idea, unless you want to be able to connect from the internet. Now you can connect with K-Menu > Internet > Krdc Remote Desktop Connection on another computer. The alternative is to connect to the box with SSH and run individual X programs on your local desktop, thus:

ssh -X hostname someprogram

This solution has the possible advantage of the computer program not appearing on the TV display, which is useful if you want to carry out some administrative task while viewing video output to the TV. Although some films may arguably be improved by the presence of a Konsole window opened on top of them, it is unlikely that family members watching the TV will agree with that. Setting X.org to put display 1 on the card won't help, as the standard VNC server will then start up on display 0. </answer>

<title>BIOS reset</title>

<question>I have four totally different computers. Six months ago I entered the same password on each of them to protect the CMOS. The password has six letters and a * and an &. Now that I need to install and change some hardware I'm finding out that none of the four computers is letting me into the CMOS with that password. There is absolutely no doubt the password is the right one. How do I reset the CMOS? </question>

<answer>It is most likely that the password you have given contains unacceptable characters. Resetting the CMOS varies somewhat from one motherboard to the next, but there is generally a motherboard jumper marked something like CLEAR CMOS or RESET RTC. You need to turn off the computer, move this jumper to the reset position ­ the is the opposite of its current setting ­ wait a few seconds then return it to the standard setting. Under no circumstances should you do this with the power on. In fact you should disconnect the power lead because the PSU will supply a small amount of power to the motherboard even when the computer is turned off. When you reconnect the power, you should find your BIOS has reverted to the default settings. The procedure can vary between manufacturers; you should only take the above a a guideline, except for the part about disconnecting the power lead ­ not doing so can wreck your motherboard. Check your motherboard's manual or search the manufacturer's website for a PDF version if you have no printed manual. It is important to stress that while the basic procedure is the same for all motherboards I've used, the details vary (one I checked required you to remove the motherboard battery too) so you must read the documentation before doing anything. </answer>

<title>Serial Capture</title>

<question>We have a small 5ESS switch which sends log files to a ROP (read-only printer) at 1200-O-7-1. The cable is the normal three-wire Unix serial cable. I have connected a PC to this using a Black Box bridge. The PC is running Windows 2000 with Procomm [a terminal emulator]. I can make a direct connection to the serial port and the logs are displayed on the screen. I am also capturing these displayed logs from the switch to a file (saves a lot of paper). I would like to do the same thing with Linux (so I can discard Windows) but am unable to make this work using tee or any redirections. Ideally, not only would this log display always be available in a window, it would continue to be captured in a file, even if the user were logged off. In addition, I would like a new file to be created every night at midnight, closing the old file. Can you help with the syntax or a workable method of doing this? </question>

<answer>The first program I would try for this is Minicom. This is a terminal emulator, much like Procomm, and should be in your distribution's software repository. If it isn't, you can get it from the website http:/ alioth.debian.org/projects/minicom. Minicom has an option to log data to a file as well as display it ­ so, providing it will communicate with your switch, it should do all you need. Alternatives involve more low-level communication with the serial port. There is Logserial from www.gtlib.cc.gatech.edu/pub/Linux/system/serial, which dumps the data from the specified serial port to stdout or a file; you could use tee to do both. There is also a Perl script available from http://aplawrence.com/Unix/logger.html, although this may require some modification to fit your requirements. To keep the program running all the time, run it in screen. This keeps the program ticking over when the user is logged out, plus you can reconnect to it at any time, even over an SSH connection from elsewhere. Provided you have set the logging and other options in Minicom's configuration, you can start it with

screen minicom

Press Ctrl+A D to exit screen while leaving Minicom running, and type screen -r to reconnect. One thing to watch out for when running Minicon in screen is that both use Ctrl+A as a command key; to get screen to pass Ctrl+A to a program running in it, press Ctrl+A A so you would use Ctrl+A A Z to show Minicom's help screen. I would use Logrotate to split the log files. This is probably already installed and running as most distros use it to rotate system log files. </answer>

<title>Give us the tools...</title>

<question>I need help with post-installation configuration of Evolution mail on my Ubuntu system. My home computer runs a dual-boot system with Windows XP on one partition and Ubuntu Linux on the other. I have an Ethernet connection to a broadband hub. Mozilla works beautifully under the Ubuntu OS ­ indeed, I have successfully used it for upgrades, Google searches etc. So Ubuntu has excellent internet access. Evolution mail, however, needs to be configured properly. An old issue of Linux Format describes a configuration wizard but I have been unable to invoke it. A Google search about Evolution gave a hit that revealed a document about setting up Evolution. At first that seemed to be very helpful but it required the use of the Tools menu on the menu bar of Evolution ­ which my version of Evolution does not have. How can I configure my Evolution without a Tools menu? </question>

<answer>As you have not stated which versions of Evolution and Ubuntu you are using, I am going to assume you are using the latest Evolution, version 2.6. Now, Evolution 2.0 has the Tools link in the menu bar, but Evolution 2.4 and 2.6 don't have it. The first time you start Evolution, you should see the First-Run Assistant. In your case, it seems that didn't work and Evolution has hidden the option from you now. To invoke First-Run Assistant, you should delete the folder .evolution (note the dot) in your home directory then type evolution from the command line. This will make Evolution think it is running for the first time and it will show the First-Run Assistant, which you can then use to configure the software. If you don't want to take the command line option, just create a new mail account by clicking on Edit > Preferences, then Mail Accounts > Add. </answer>

<title>Kino konundrum</title>

<question>A few days ago I installed Kino using Synaptic on my Ubuntu 6.06, I think the Kino version was 0.8 and it worked very well in all respects, including capturing from my camcorder. Today I accepted the offer of an Ubuntu automatic update to Kino 0.9.2 but when I run Kino now it won't capture. Instead it gives the message:

  `Warning: dv1394 kernel module not
  loaded or failure to read/write /dev/
  ieee1394/dv/host0/PAL/in'.

My camera shows up correctly as the capture device and Dvgrab from Kino captures without problem (horrible to use) so surely the 1394 must be working. Any ideas on how I can fix this? </question>

<answer>Hmmm. Did you update anything else at the same time? Ubuntu uses udev to manage devices, and at the moment the raw1394 device doesn't play nicely, so it doesn't get created (there is the same problem on Fedora and other distros that now embrace udev more completely). So, that is the likely `why' As for what you can do about it, an inelegant hack is to merely create the device node yourself:

mknod /dev/raw1394 c 171 0

That should take care of it. If it doesn't, check that the relevant modules are actually being loaded! Running lsmod should tell you if raw1394 and video1394 are loaded properly. You may need to change the permissions on the device to get Kino to read it properly. As a side point, there is much consternation among the distro packagers regarding Kino's insistence on using the raw1394 device. Apart from everything else, relaxing permissions on this device does raise security issues. At some time in the future, Kino may end up using a more regular device to access DV devices. </answer>

<title>Rights and wrongs</title>

<question>If I was to use images from the net in a slide show, what would the rules concering these be? I can't find any associated copyrights to the images I want to use and nothing is marked down, but I was wondering what the rules are govering the use of images from the internet. </question>

<answer>In the UK, copyright applies at the moment of creation, and does not need to be explicitly stated. So, for unknown images on the internet, you should assume they are copyright unless stated otherwise. However, there are exceptions granted in the UK to copyright, mainly in the case of research or fair usage (eg if you were reviewing a website, it would be considered fair usage to include an image of it). The UK patents site has some useful information on this: www.patent.gov.uk/copy/c-manage/c-useenforce/c-useenforce-use/c-useenforce-use-exception.htm. So under some circumstances you can still use them legally, but ultimately, it is better to ask permission. If you just need general images to use for your presentation, can I suggest you search for Creative Commons-licensed work? Check out www.creativecommons.org. </answer>

<title>Dodgy DMZ</title>

<question>I have set up a web server (SUSE 10.0) running inside a virtual machine that is hosted on my SUSE 10.0 box. I have configured it to be in the DMZ of my router (also SUSE 10.0). Web traffic is correctly routed to the box; however, I cannot seem to access it from the internal network on any port. I would like to be able to ssh directly into the box from within the internal network. The firewall on the router (192.168.0.9) was configured using aYast and maps its external port 80 to the web server (192.168.1.2). I tried mapping the internal (192.168.0) port 80 to the web server but this doesn't seem to work. Is it possible to do this with the Yast tool? If not, is there any easy way to convert the existing Yast setup into an Iptables script where it should be easy to achieve? Hope you can help... </question>

<answer>I would highly recommend that you install IPCop, a specialist Linux firewall distribution, instead of using SUSE 10.0 for the router. I used IPCop for a long time before I switched to Cisco PIX firewalls, and it only takes a few minutes to install. IPCop uses the concept of a `Green network' for an internal protected interface such as your web server's, and this makes it relatively easy to join to two networks like yours together. There is an excellent HOWTO about IPCop at http://howtoforge.net/perfect_linux_firewall_ipcop_p2, and the project homepage is located at www. ipcop.org. </answer>