Answers 108

From LXF Wiki

Answers 108

<title>Mislaid 30GB</title>

<question>I installed Linux Mint from LXF105 and, being new to Linux, followed the instructions about partitioning. However I was installing on a laptop with Windows already taking up two partitions therefore when I partitioned according to the magazine I found that (only being allowed four partitions or something) I am unable to access a large chunk of my hard drive. I dedicated 10GB to / and 512MB to swap, but the partition editor in Mint won't let me do anything. </question>

<answer>A PC hard disk is limited to four partitions, one of those wonderful limits from the days when people still thought it was fine to say "no one will ever need more than..." The solution is a kludge, but one that works very well, to make one of those four primary partitions an extended partition, which can act as a container for so-called logical partitions. In this way, it is possible to have a lot more partitions ­ as many as you have space for, in fact. Your problem is that you have already used up your four primary partitions and so have nowhere to create an extended partition. The solution is to remove one of your existing partitions (the one next to the unused space) then all of that space can be used for logical partitions. If your partitions are in the order you gave them ­ Windows, Windows, Linux root, Linux swap and then the unused space ­ you only have to remove the swap partition to be able to make use of all of the space, and you can do this while the system is running. Open a terminal and run

sudo swapoff -a

to disable your swap, then run the partition editor as you have done before. Delete the swap partition and you should now find that you are able to add extra partitions. You don't have to worry about the primary/extended/logical nuances, just tell GParted to create a partition. If it asks whether you want to create a primary or logical partition, answer logical and it will take care of creating an extended partition to hold it. The first thing to do is create a new swap partition to replace the one you just deleted, which will be called sda5 ­ logical partitions are always numbered from five, no matter how many primary partitions you have. After you have finished editing the partitions, you will need to enable your new swap partition. Go back to your terminal and run

mkswap /dev/sda5
sudo gedit /etc/fstab

Find the line that refers to swap and replace the UUID=xxxx part with /dev/sda5 (or whatever your new swap partition is called). When you reboot, you will still have a swap partition and another 30GB of disk space to play with. </answer>

<title>Hidden panel</title>

<question>I am new to Linux having loaded Xubuntu from LXF99. Since loading this has been upgraded by the inbuilt facility and the Grub screen now tells me that I am loading `ubuntu 7.10, kernel 2.6.22-14-generic'. My problem is that I have lost the panels, or taskbars, from the desktop and can therefore no longer reach and activate the various applications. This occurred once before, but at that point I was still using the Xfce desktop and so a right-click brought up the Applications menu and I was able to change settings. This time I had changed to a Gnome desktop and the right-click only enables me to bring another icon on to the desktop or a few other unhelpful alternatives. It would seem to me that if I could reactivate the Xfce desktop from a terminal I could get a useful computer back. </question>

<answer>There are two separate questions here: how to switch back to Xfce and how to restore the Gnome panel. The first is the simplest to answer, at the login screen, click on `Session' below the login/password box and select Xfce as your desktop. You will now log into the Xfce desktop you had before, after having the option to make this the new default. Gnome is not installed with Xubuntu and is not included in an update either, so you must have installed Gnome yourself at some time. While it is possible to delete panels, Gnome will not normally allow you to delete the last one ­ ie, there must always be one panel running. To check that gnome-panel is running, and restart it if necessary, run gnome-panel from a terminal. This should give you an error dialog about a panel already running. You can kill this panel process, forcing Gnome to start a new one, with

killall gnome-panel

Your panel may now reappear ­ if it doesn't, the panel is either hidden, invisible or of a very small size. To change the properties of your panel, even when you cannot see it, run gconf-editor in your terminal. Navigate to Apps > Panel > toplevels > panel_0. From here you can change many of the settings for the panel, even if you cannot see it. Click on an item in the Name column to see a description; click in the Value column to change it. Once you have got your panel back, you may find that it is empty, in which case you will need to reinstate the applets you need. Right-click on the place in the panel you want an applet to appear and select "Add to panel..." To add the main application menus, choose Menu Bar (not Main Menu) from the bottom of the list. </answer>

<title>LVM</title>

<question>Under my vanilla Fedora Core 5 installation, the new Fedora 8 installation shows up as two partitions: /dev/hda7 and 8 under both fdisk and /dev, with none of the /dev/VolumeXX/GroupXX stuff I've been finding described on the net. I'd like to add an entry for Fedora 8 to my grub. conf file so I can boot it. I have been using Fedora Core 5 happily for a while, and it contains all my customisations and data. </question>

<answer>Fedora Core 5 and Fedora 8 use a similar LVM setup, and this is the source of your problem. Both distros name the first volume group VolGroup00. LVM uses names to distinguish between volume groups, and it cannot cope with two groups having the same name. As a result, it ignores the second one, which is why you cannot see its contents. The solution is to rename one of the groups, but you cannot rename the Core 5 group, because that is in use, and you cannot rename the other one, because the system cannot see it until the name is changed. The best way around this is to boot from a recent Live CD distro like Knoppix to give unfettered access to the volume groups. When Knoppix boots, open a terminal and run su (no password needed) to become root. Later versions of the LVM tools can identify different volume groups with the same name. Run vgdisplay and you'll see two groups both called VolGroup00, each with a different UUID. You can probably tell which volume group belongs to which disk from the sizes, so rename the Fedora 8 group with

vgrename xxxxxxxxxx Fedora8

replacing xxxxxxxxxx with the UUID from vgdisplay. You could now reboot into Core 5 and see both sets of logical volumes, although you will need to edit /etc/fstab on the Fedora 8 root filesystem to match the new name. You would still have a problem if you added another Fedora disk later, so it is best to rename both volumes now. If you do this, you will need to make some changes to boot with the changed name. First edit the boot menu with

mount /dev/hda7
joe /media/hda7/grub/menu.lst

to mount the boot partition and load the menu into an editor. Change the VolGroup00 reference and press Ctrl+K X to save and exit. Now mount the root filesystem and edit /etc/fstab with

vgchange -a y
mkdir /media/root
mount /dev/FC5/LogVol00 /media/root
joe /media/root/etc/fstab

The first line activates the renamed volume groups. Change the two instances of VolGroup00 to FC5, or whatever you named the volume group. Press Ctrl+K X to save and reboot. Of course, if you were feeling particularly lazy, you could reinstall Fedora 8 and set a different volume group name during installation. Now that you have non-conflicting volume groups, you can add an entry to Core 5's boot menu to pass control to the Fedora 8 menu.

title Fedora 8
root (hd1,4)
chainloader +1

will pass control to the bootloader on /dev/hdb5. I would also recommend setting up a separate home partition, so that future upgrades will be possible without losing your personal data and settings. </answer>

<title>Debian without internet</title>

<question>I am new to Linux and am currently learning the basics using a Debian-based system, but have problems installing new programs. I do not have internet access at home, but use the computers at the local public library (which run on a Windows system) and use a memory stick to transfer data to my computer. I have tried installing Linux programs I have downloaded, using the package manager, but this doesn't seem to work. I also have the same problem when trying to install programs from DVDs, such as appear with your magazine. I have looked through the books on Linux and the back issues of your magazine that I have, but cannot find anything to help. Could you possibly tell me how to proceed to install a program saved on memory stick or from a DVD? </question>

<answer>Debian's dpkg package manager, which is the low-level program behind graphical managers like Synaptic, is able to install directly from package files. To do this, use the following command from a terminal

sudo dpkg --install somepackage-1.2.3.deb

If you are using Ubuntu or one of its derivatives, or

su
dpkg --install somepackage-1.2.3.deb

for any other Debian-based distro. It is possible to install several packages at once, either by giving all their names on the command line or by passing the name of the directory containing them, as in

sudo dpkg --install --recursive /media/usbstick

However, you still need to know which files to download, so there is another option. Run Synaptic, mark the packages you wish to install and use the File > Generate Package Download Script menu item. This creates a shell script to download the files you need. Although you cannot use this script directly on most Windows computers, you can copy and paste the URLs from the file into your download software and put the downloaded files on your USB stick. Then plug it back into your home computer, run Synaptic and select the File > Add Downloaded Packages menu item, go to the directory containing the files you downloaded, click Open and Synaptic will install them for you. Updating the lists of available programs is a little more tricky, but possible. Look in /etc/apt/sources.list and you will see a line like this for each source

 deb http://gb.archive.ubuntu.com/ubuntu/ gutsy main restricted

Using this example, browse to http://gb.archive.ubuntu.com/ubuntu/dists/gutsy and go into the Main and Restricted directories. In each of those you will find a binary-i386 directory; download the Packages.bz2 and Release files in there and save them using the full path with each / changed to a _, as in:

 gb.archive.ubuntu.com_ubuntu_dists_gutsy_binary-i386_Packages.bz2

Copy each of these to your USB stick. Take it home and copy all the files into /var/lib/apt/lists/, as root, and unpack the .bz2 files. It is easiest to do this from a terminal with

 cd /var/lib/apt/lists/
 sudo cp /media/usbstick/*.bz2 .
 sudo bunzip2 *.bz2

Now fire up Synaptic and it should have all the latest versions available. It's a bit of a fiddle, but the system was really designed for use with an internet connection. </answer>

<title>Memory testing</title>

<question>Some of the cover discs and distros, when they boot up, have a menu list with install options that sometimes include a hardware check utility like the Memtest app. Is it possible to have that code and the program boot from a hard disk partition, and how would one go about it? </question>

<answer>This is indeed possible, and often very simple. Some distros have a package for Memtest86 or Memtest86+, a fork of the original project. In such cases, installing from the package manager will usually add a bootloader menu entry and everything is done for you. If you want to install manually, go to either www.memtest86.com or www.memtest.org, depending on which variant you want to try, and download the pre-compiled version. In the case of Memtest86, this is marked as "installable from Windows and DOS" but it can also be installed from Linux. Unpack the archive and copy the .bin file to /boot ­ you will need to be root to do this. Then, also as root, edit /boot/grub/menu.lst (some distros use /boot/grub/grub.conf) and add one or both of the following sections, depending on which variant you installed.

title memtest86
kernel /boot/memtest.bin
title memtest86+
kernel /boot/memtest86+-2.01.bin

If you have a separate /boot partition, you can omit the /boot part from these, for example

kernel /memtest86+-2.01.bin

If your distro uses Lilo instead of Grub, add either of these sections to /etc/lilo.conf

image=/boot/memtest.bin
label=memtest86
image=/boot/memtest86+-2.01.bin
label=memtest86+

Don't forget to run /sbin/lilo after changing lilo.conf! </answer>

<title>Hot-swap SATA</title>

<question>I have several 500GB SATA hard drives with all my movies on them. Instead of putting them on a server and running them across the wire, I have chosen to have a removable tray in my media computer. The only problem is that I must shut down the computer to change hard drives. I want to be able to hot-swap disks, but I'm not aware of a way to do that under Linux, as the drive tables are loaded when the kernel is brought up. </question>

<answer>What you are looking for is hotplugging on SATA, which is dependent on the hardware in two areas. The drive caddy system you use must be hot-swappable; most are, but check before you buy. The lock is often necessary, although some caddies use a sliding catch rather than a key, because it not only locks the drive in place but also controls the power to the drive. Unlocking the drive powers down the drive so it is not still spinning when you physically yank it out. Secondly, your SATA controller must handle hot-swapping. It must be able to recognise when a drive has been disconnected or connected and communicate this information. Provided that happens, the OS should handle hot-swapped SATA drives much the same as it does USB or FireWire drives. Identifying suitable controllers is not so easy. I've had complete success with Intel ICH8 controllers running in AHCI mode, which seems to be the most important factor. If your SATA controllers are AHCI compatible (there is often a BIOS option to enable or disable this if they are), you should be OK, but search Google for your particular controller(s) first. Watch the system log with

tail -f /var/log/messages

while pulling and replacing the drives. You should see various messages relating to the disappearance and reappearance of the drive. If this ends in success you are ready to use them, although there is one more factor you may need to consider. If you want the drives to be automounted and your automount system uses pmount to do the mounting (pmount allows mounting by a normal user without an entry in /etc/fstab) you may need to edit /etc/pmount.allow. If the drives are seen as non-removable, which SATA hard disks usually are, pmount will refuse to mount them unless you add the device name to /etc/pmount.allow, for example.

echo `/dev/sdb1' >>/etc/pmount.
allow
echo `/dev/sdc[123]' >>/etc/
pmount.allow
echo `/dev/sdd*' >>/etc/pmount.
allow

The first allows one particular partition to be mounted by pmount, the second example permits three specific partitions on a drive, while the third lets through every partition on a drive. Note the use of single quotes to stop the shell interpreting the wildcards. </answer>

<title>Ubuntu restart</title>

<question>I have Feisty Fawn up and running reasonably well on an old PC. I had no problem going through most of the programs except when I tried the games. The only one that gave me grief was a card game that I play a lot on my XP that uses two banks of four cards. Every time I tried to play, it would freeze the computer at some stage, always. I thought perhaps it would be OK if I reloaded Feisty, but I can't try any of the Live disc programs, and I can't seem to get out of Ubuntu. How do I get back to a clean hard drive to start again? I am lost when it comes to uninstalling, I don't seem to have this problem with Windows. I have not yet been able to connect to the internet so I have lots of files that need a connection before they can be used, I don't want to keep swapping my broadband between the two computers. I must be doing something wrong somewhere, but I feel must persevere. </question>

<answer>Reinstalling the whole operating system to deal (sorry) with one card game is not the solution. All you'll do is spend an hour getting back exactly where you are now. The answer is to search Google or the Ubuntu forums, or ask on the Linux Format forums at www.linuxformat.co.uk, giving the details of the game involved. If this game was included with Ubuntu, the fix is most likely quite simple. It sounds like your computer is set to boot from the hard drive before the CD/DVD, so you need to explicitly tell it to boot from the Live CD. Most computer BIOSes have a boot menu ­ press a key at boot time and it asks you which drive you want to boot from. If not, go into the BIOS when you power on the computer and change the boot order so that the CD/DVD drive is before the hard drive. A third alternative is to use Smart Boot Manager, which you'll find on any of our LXFDVDs. Copy this to a floppy by opening a terminal and running

sudo cat /media/cdrom0/Essentials/SBM/ sbootmgr.dsk >/dev/fd0

with a floppy disk in the drive. Now reboot and choose `CDROM' from the Smart Boot Manager menu. If you're using a DVD, don't worry ­ you still use CDROM. You don't say what type of broadband you have, but if your modem has an Ethernet port you should be able to connect it directly to the computer with a standard network cable, then set Ubuntu to obtain an address automatically (this is the default, so you shouldn't need to change anything). To use your internet connection with both computers, you need a router. Either a cable modem router that connects to your cable modem or, if you have ADSL, a combined modem/router that connects to your phone line with each computer is plugged into it. These are very cheap nowadays and make connecting computers to the internet and each other extremely simple. </answer>

<title>External drive booting</title>

<question>I am new to Linux and am exploring all the distros. I have XP dual booted with Ubuntu and I then added a second drive installing SUSE 10.3 on to that. The Ubuntu install created a boot menu including Windows, and when I installed SUSE it installed its own boot menu listing both Windows and Ubuntu. When selecting Ubuntu from the SUSE menu I am returned to Ubuntu menu, which works as before. I now want to boot into a 250GB USB drive holding PCLinuxOS. When I tried a direct install of PCLinuxOS, it installed its own boot menu which deleted the SUSE menu and only listed PCLinuxOS and Windows. Is there an easy way to add OSes on the external drive to the SUSE boot menu or quickly create a new one to include all OSes, so as to boot any selected partition internal or external? I am not very good with the command line having just migrated from Windows. I understand partition labels and numbering having read various Grub tutorials but don't want to trash my existing boot system unnecessarily. My second drive is recognised by the BIOS. </question>

<answer>Normally a distro installs its bootloader to the Master Boot Record (MBR) of the first hard disk. When the computer boots, it sees the bootloader here and passes control to it. The problem with this is that each installation overwrites the previous one, as you have found out. Once you have a working boot menu that you like, you can prevent any other distro from overwriting it by taking the option to install that distro's bootloader to the root partition, which may be hidden in some advanced section of the installer. This means that the distro's bootloader is not written to the MBR and the original bootloader is untouched. Instead, it goes to the start of the main system partition used by that particular distribution. Now you can edit the original distro's boot menu to add an option that passes control to your new distro. First you need to know where the root partition is, which you should have seen during installation. If you are installing to the first partition of an external drive, it is probably /dev/sdb1. Linux designates hard drives as sd (or sometimes hd) followed by a letter ­ `a' for the first drive and so on, and a number for the partition, starting at one. Just to confuse you, Grub uses a different scheme and labels drives (hdx,y) where x is the number of the drive and y the number of the partition on that drive, both counting from zero. So the first partition on the second drive is /dev/sdb1 in Linux terms and (hd1,0) to Grub. Now you understand that, boot from the distro that owns your main bootloader, SUSE in this case, and edit it to add an entry for the new distro. You can edit the bootloader in Yast or by editing the file /boot grub/menu.lst directly (you have to do this as root) in a terminal with

 su
 nano /boot/grub/menu.lst

Scroll down the text and you will see the existing menu entries, then add one for your new distro with

title My New Distro
root (hd1,0)
chainloader +1

The first line is the text for the menu, the second tells it the location of the partition containing the new distro's bootloader and the final line passes control to that bootloader. Select this and you will see the new distro's boot menu. If Grub reports error 21 or 22 you have incorrectly specified the partition in the root line. You can press E while your new menu entry is highlighted, select the root line and press e again to edit it. Change the root line, press Esc to apply the change and B to try booting it again. You cannot do any damage when experimenting like this. Once you find the correct value, edit the menu.lst file as above to make the change permanent. </answer>

<title>Samba, baby</title>

<question>I am running Samba on my Linux desktop so that my Windows laptop can access files in the desktop. If I need to access the files on my Linux desktop from another Linux laptop, do I need to run Samba? I tried TightVNC the other day and was able to see the other person's desktop. Can I use it to transfer files like in Samba? I then came across something call KDE Remote Desktop Connection. Is this something like VNC? Which is the preferred method, VNC or Remote Desktop? SSH is something else that I've read about but not tried out yet. Wikipedia states "Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two computers." Does this mean that it is something like Samba that allows a connection between my laptop and desktop or only between Linux computers? Or is it a totally different beast? </question>

<answer>Samba is a server to allow other computers to access files using the Windows SMB and CIFS protocols. Although it was originally intended to make files on a non-Windows computer available on a Windows network, it has grown beyond that. As it is a server, you do not need it running on a computer that is used to access files from a Windows system ­ you only need the client side of the software, with no server running. The client programs are usually installed by default and are often included in a separate package to avoid the need to install the whole of Samba just to access files from a Windows network. You can also use Samba to share files between Linux computers. There is a more native method called NFS (Network File System) but if your network contains a mixture of Windows and other operating systems, it is often simpler to stick with Samba for everything. TightVNC, a variant of the original VNC suite, is completely different, allowing remote access to the graphical desktop of another computer. It does not include file transfer facilities because you are doing everything on the remote computer, but using your local keyboard, mouse and monitor. KDE's Remote Desktop Connection is a front-end to both VNC and the Windows Remote Desktop Protocol. It can connect to computers using either method, determining the best protocol to use on each connection. SSH is also different, providing a way of logging in to a command shell on a remote computer using an encrypted connection, making it secure for administrative tasks over an insecure connection, like the internet. SSH also provides file transfer facilities, through the use of the command line scp and sftp programs. The latter can also be used with graphical file managers. Type stfp://user@domain/path/to/directory into Konqueror's location bar to display the contents of the directory from the remote machine (provided you have SSH login access of course). There is also an SSH program for Windows called Putty (www.chiark.greenend.org.uk/~sgtatham/putty).

</answer>