|
    |
|
Solve all your email problems!
|
 |
 |
Tutorial: Multiple Linux Distros |
 |
Multiple Linux distros on one drive
(With or without Windows)
Disclaimer:
This is a relatively simple setup. I don't have any servers on my
system (except SAMBA, but that doesn't count), so no Apache, MySQL, or
Fetchmail. Nor do I do development. I don't use KMail, Konqueror
or Evolution (I'm a Mozilla Mail kinda girl). I also don't use KDE. So
issues like cross-distro server logging, development project
consolidation, specific KDE tools, or mail consolidation for anything
other than Mozilla/Thunderbird/Netscape (if anyone is still using
that) is not going to be covered here. I also still have
a Windows install, so I did use Windows tools for some parts of this
setup and will include that for those reading this that will also
retain Windows. If your system is significantly different (you have a
mail server, you have removed Windows completely, you use Evolution),
you can probably adapt this tutorial to figure out the necessary
changes, where I don't indicate them myself. This is a fairly rough
guide, and while it worked (and still works) for me, I cannot guarantee
it will work for you (because you are not me). So be very careful, and
please do your research before just blindly following this guide.
Thanks.
My original goal was to have 5 installed Linux distributions multi-booting with
2 versions of Windows, with certain files available under both Windows
and all distributions of Linux, and certain other files available under
all distributions of Linux. My intention was to prevent duplication of
large blocks of data that I would be using under all distros/OSes---
for example, N(ever)W(inter)N(ights) is some 2GB, and I had no
desire
to have it installed 5 times, onto 5 different partitions, just to play it
under every distribution. My HDD is just not big enough for that, plus
it's annoying ;-).
The files I
needed under both Windows and all distributions of Linux
were:
- audio/video files;
- installed Win
applications that I would want to also run under Wine (including
games);
- downloaded mail;
- miscellaneous personal
data such as my CV, source material for my web-page-in-progress, files
that I was planning to burn to CD, etc.
- shared network data
(data shared from me to the network, which is a Win2000 machine).
The files I
needed under all distributions of Linux were:
- Linux "non-installables". Most programs under Linux
are installed to specific locations per distro, either via binary
installers (.rpms, .debs) or scripts (Makefiles/make install, compiling
from source, Slackware .tgzs, Gentoo portage scripts), but quite a few
are not. Firebird/Thunderbird currently are extracted to any location
you choose, as are Seti@Home, NWN, and Quake. Kingpin uses an install
script, but you can choose the location. And games that you plan to
install under Wine can be installed to any real location you want, by
reconfiguring wine.conf. Some of these apps are really big, and since I
planned to use them under all distributions I wanted them to reside in
the same location. Yes, I would still have to "install" some of them
more than once in order to have each disto recognize that the app was
there, but if I installed them over themselves in a shared location,
they would not take up extra space for the same files.
- Collection
point for various downloaded Linux files
(drivers,
miscellaneous apps that have to be compiled, loose RPMs and TGZs, icons
and themes, etc.).
All of these files needed to be owned by me (as a user) under all
circumstances, no matter which distro I was booted into, which meant
that they had to somehow be in my ~/ directory (that's my ${HOME}
directory, or /home/username), as 1) that's more convenient in terms of
file navigation; 2) files can only be shared to the network from one's
/home directory; 3) putting them elsewhere would probably screw up the
permissions, making me unable to use the files.
Disclaimer 2:
I have
explained my goals fairly thoroughly because this is not
the Windows world, where you're given a plate and told to eat what's on
it, period. Linux users are expected to think about what they're doing
before they do it. So now, reader, you should be thinking about how
your goals in installing multiple distros are different from mine, so
that you can filter the following instructions based on your needs. If
you haven't thought about what your needs are, you should do that now,
and at least you have a place to start considering what those needs
might be. Maybe you don't have a network that you need to share files
back to (or need to receive files from). Maybe you don't play any games
but pysol, and won't be installing games/apps under Wine/WineX. Maybe
you have an FTP server or Web server that you'll want to run under all
distros. How are you not me?
Oh, I suppose I
should mention: I did
succeed at my goal.
So, how did I do
it? OK, here we
go. The easiest way I found to set this up is to pre-partition
before installing anything. If you have a Windows install, I suggest
Partition Magic if you have it, but there are other partitioning
utilities available if you don't. If you have Mandrake, running the
install through the partitioning section, then rebooting is also good
(DiskDrake is stupendous), or you can use any other distro's partition
tool (fdisk or cfdisk) to set up the partitions. Set up all /
partitions
for Linux (except the swap of course) as ext2, any shared data
partitions for Linux as ext3, and any partitions
with shared files needed to be visible to a Windows install (either
your own or one
elsewhere on the network) as FAT32.
How big should your partitions be?
This of course depends on 1) how much HDD space you have; 2) how much
HDD space you need (if you're not
installing KDE and GNOME, you
don't need as much space as if you are); 3) how much memory you have
(relates to the size of the swap file); 4) what distros you're
installing (some distros contain more bloat by default than others);
and 5) how much space you need for the various types of shared files.
Since I don't know the answer to most of these questions for
you,
I will only say that the minimum "comfortable" size for my Mandrake 9.1
install (Mandrake being the most "bloated" distro I use) is about 4 GB.
But again, I don't run any servers, so I don't have to worry about
Apache, databases, or expanding log files.
I
have no idea if you can share /var between distros if it is on its own
partition
(this is where log files are usually kept), and
while you can technically share a /home partition across distributions,
I do not recommend it. It is also not recommended to install more
than one distro to the same / partition (for ex-Windows
users, this is essentially the same as installing two versions of
Windows to the same C:\Windows or C:\WINNT directory, and as a Windows
user, you should be able to guess what a nightmare that would be).
In general, I would suggest
5 or 6GB per distro for a "normal home user". This should leave you
plenty of space for additonal software not originally installed by the
distro that you come across later in the distro's repository. Don't
forget, most of the programs/files that are going to be "clogging up"
your drive are not going to live in the
distro's / partition-- like Wine games that you might install, then
uninstall, or media files that you might get more of--
so the / partitions don't really have to be "expandable".
You just need enough space so that if you didn't originally install
GNOME or OpenOffice, or Apache, or MySQL, you have space to install
them later-- and by comparison to that 2GB NWN install, we're not
talking about a great deal of space, even for all four of those
together (probably around a quarter of that 2GB).
So if we're talking about 3 distros on a 40GB drive, we've used 18GB
for the 3 distros, 1GB for swap (it's probably only 512MB, but I'm
rounding this up to a full gig for the numbers, and maybe you're
installing RH9, which will warn you if you don't allocate a real "2X
RAM", so if you have 512MB memory, it really wants a gig of
swap---!!!). So we've still got
about 20GB left for the shared partition(s). Divvy that up however
seems best to you (if you have to divide it at all). You might also
choose to use only part of that 20 GB and leave some of it
unpartitioned free space so you can expand one or more partitions later
if you need to (you can do this "on-the-fly" with FAT32 partitions--
under Windows at least, possibly under Linux as well-- and you can also
try doing that "on-the-fly" for Linux partitions by using parted, but I
don't know how well that works out, never having tried it).
Important notes on partitioning a multi-boot that involves
Windows
Do NOT let any of your Linux partitions be primary if you intend to
boot Win2K or XP (or, gods help us, ME) alongside the Linux boots.
Linux installers will normally auto-partition everything it can as
primary partitions, but when you boot into Windows, good ol' Windows
will try to
identify the "new" primary partitions with the Add New Hardware Wizard
in order to give them a drive letter. Windows can't understand Linux
partitions, of course, so it will fail at this, but will keep trying.
For every "foreign partition". Every time you boot into Windows.
Insanely annoying. This doesn't seem to happen under 98 because 98 is
good-naturedly stupid and just ignores what it can't understand (which
is in this case A Good Thing).
Linux does not need any of its partitions to
reside on a
primary partition (unlike Windows). All Linux partitions, including the
boot and swap partitions, run perfectly fine from a logical partition
inside an
extended partition (and we're not making a separate /boot partition
anyway), and if they are set up this way, Windows will just
ignore them on boot.
Installing the distros
If you plan on running Windows beside the Linux distros, it is best if
Windows is installed first. If you intend to run more than one version
of
Windows beside the Linux distros, the oldest Windows version must be
installed before the newer Windows version, and then install Linux. This is to minimize
bootloader problems. The Windows installer will always erase any
bootloader that exists in the M(aster) B(oot)R(ecord), which contains
the master table of what bootable partitions exist on the system. But a
newer version of Windows will detect an older version and create a
dual-Windows boot with it. Then Linux will detect that there is a
Windows boot and create a dual-boot with that (choosing the Windows
boot under LiLO or GRUB will take you to the Windows boot menu, where
you can choose which version of Windows you want to boot).
If you have a third-party (Windows) bootloader that you would like to
use (there may be 3rd party bootloaders for Linux, but I don't know
what they are), you can simplify the whole bootloader thing immensely
by opening its config utility after you have made your partitions and
simply pointing each menu entry to the (empty) partitions that you will
install each distro to. The entries will remain invalid until you
actually install the distros, of course, but as soon as you do, you
have a complete working bootloader. It is also possible to install
Linux entries to the Windows bootloader if you have some twisted desire
to do that. Instructions for this rather complicated process can be
found at NT OS
Loader + Linux mini-HOWTO, or more simplified
instructions are at
linux on the
nt bootloader.
Whether or not you plan to have a Windows install beside the
Linux
installs, you will mostly be installing each distribution normally.
During the partitioning phase, choose "Custom" partitioning, skip any
offer to use fdisk or cfdisk (you have already created the partitions,
so you don't need to do it again), and point the installer to your
pre-created swap and / partitions. Feel free to "initialize" (format)
the / partition you've chosen to any filesystem you prefer (ext2, ext3,
ReiserFS, JFS, XFS, etc). Write down the
Linux designations of
all partitions on your drive(s), especially noting which partitions
that you install each distro to!! (meaning
"Mandrake is on /dev/hdb7", "Windows is on /dev/hda2", "the swap
partition is /dev/hdb5", "the shared Linux partition is /dev/hdb9" or
whatever your setup is).
You will want this
reference when you get to editing the various config files, if you
need/want to wipe a specific partition for whatever reason, or need to
mount the root filesystem of one distro under another to check
something quickly without rebooting to that system.
When you get to the part where the bootloader is installed, tell the
bootloader to install itself to the root partition of the distro -- except
in the case of the last distro you install, which should install its
bootloader to the MBR, unless you are already using a third-party
bootloader, in which case install all of the bootloaders to the root
partition of the distribution. Make a boot floppy for each distro.
This will affect the order in which you install the distros on a pure
Linux box, to the extent that you may want the distro with the
"prettiest" bootsplash/menu to be on the MBR, or if you prefer a
specific bootloader, you probably want to install the distro that uses
that bootloader last in order to have it on the MBR (most distros
install LiLO, but many people feel that GRUB is easier to manage for
this purpose, and a few distros do install GRUB rather than LiLO by
default). You can usually find out which bootloader each of the
distros you want to use loads on the distro's homepage (often somewhere
in the package list, or the install instructions may well mention).
The only other thing you may want to do is create a "dummy" regular
user (i.e. username:"dummy" pw: "junk") during the install, instead of
the real one that you will commonly use. This relates to simplifying
the process of sharing partitions, especially with mounted Windows
partitions shared across the network, but is not necessary to share
Linux partitions between distributions. Read the section on sharing
partitions first, then decide if you want to do this.
Once you're done, you will only be able to boot into the last-installed
distro unless you use the boot floppies you made or you set up a
third-party bootloader as above. The first thing you want to do is fix
that. Boot into the distro you can boot from the HDD. You can log in as
root if you want, but it's probably better to log in as your normal
user and su to root (and if you don't know what that means, you should
probably stick to just one distro until you do, no offence :-P.
The theory here is that you want to open the config file for the
bootloader and edit
it to add the menu entries for the other distros you've installed. For
LiLO, you'll want to edit /etc/lilo.conf. For GRUB you'll want to edit
either grub.conf or menu.lst (apparently this can vary somewhat by
distro or method of installation). I don't use GRUB myself, but the
configuration files are in /boot/grub by default. General instructions
for
adding an additional Linux entry to GRUB and LiLO can be found here, about
two-thirds of the way down the page, under the heading "LiLO and GRUB".
These instructions are for adding an additional kernel entry for the
same distribution already installed, but I offer it to give you a
general idea of how to perform the editing (since you are essentially
adding another kernel to the menu, after all). Another page with good
info on configuring GRUB for multiboots (in this case, Linux and BSD)
can be found here.
You might also want to take a look at Multibooting
101. It's not very detailed, though. MUO (MandrakeUser.org) also has
a nice howto on configuring GRUB for multiboot, as well as an equally
nice one for configuring LiLO. However, please see the
GRUB manual or lilo.conf(5)
for greatest certainty. If
you use LiLO, don't forget to run 'lilo' or '/sbin/lilo' to set your
changes!
OK. once you've got everything installed and booting from your
bootloader, you'll want to set up the shared partition(s).
Sharing partitions between OSes:
Whether you're mounting/sharing a FAT32 or ext3 partition, the first
thing you need to do is go to your user configuration. This is easiest
done with a GUI tool, such as Mandrake's UserDrake, RedHat's User
Manager, KDE's KUser, GNOME System Tools (one of which is a Users and
Groups tool), or Webmin (to name all of the ones I can think of
offhand), but can (as with all things Linux) be done via the command
line as well. This is getting pretty long, so whether I'll cover the
CLI method is anybody's guess. (Turned
out, "Not." Sorry. :-( ) But if
you're such a CLI jockey, you're not reading this anyway, so....
What we're about to do here:
The deal is that user ownerships/permissions are based on UID (user ID)
and GID (group ID). Every user has a numerical UID and is associated
with one or more numerical GIDs. Two users might have the same username
(theoretically, I don't think you can actually do that), but different
UIDs, thus would not be the same user. So you're going to want to know
what your UID is, and you're going to want a special GID for a special
group.
Why?
Because you (as a user) want to own mounted partitions across various
distros, and possibly share them to the network. This means that you
will want to mount them to your /home/username directory, because you
only own files in that directory, and you can only share files from
that directory. But when you mount these
partitions using the special settings in /etc/fstab that I will tell
you, they will acquire your normal UID and GID for that distro.
Then when you boot into another distro, you won't be able to access the
mounted files created under the first one, because they belong to a
different UID or GID or both. To prevent this, we have to conform
either the UID or GID or both across all distros. In the case of shared
FAT32 partitions, I prefer to conform both UID and GID; for shared ext3
partitions, only GID is necessary.
So, here we are in the User Configuration Tool, to do just that. And
yes, we will be doing both the User/Group Configuration and editing of
/etc/fstab under each installed distro, so just assume that "rinse and
repeat" is tacked on the very end of all this.
First, we're going to create a new group. Go to the "Groups" section of
the tool and add a new group. Call it whatever you like (sharing,
fileshare, scumsuckers, I don't care, it's your group :-D.) Note the
GroupID of this group.
Special Note:
Mandrake (and possibly other distros) provides an alternative way to
create this particular group.Go to the Mandrake Control Center, then
choose the Mount Points section on the left-hand side. On the right
side, you should now see a tool that allows you to configure
filesharing. Choose it and set file sharing to "custom". This
will create a new group called "fileshare". Close this tool and
return to UserDrake to continue with the non-Mandrake people.
The following procedure is why you might have wanted a
"dummy" user who will be deleted as soon as we're done with all this.
Some distros make it very difficult to change the UID of a
already-existing user, but allow you to use an "Advanced" button to
choose the UID of a user that you create using the User Management tool
(whatever one you use). So if you did create a "dummy" user (who you
should currently be logged in as), use the tool to create a new one
using your regular user name and password. Use the "Advanced" button or
tab to specify the UID (this can be any unused uid-- and you will see
several already used for various system services-- but it's easiest to
just increment the "dummy" user's UID by one, since some distros
restrict what numbers may be used for a UID). Make a
note of the UID. Add the new user to whatever groups you
need to be part of: wheel, users, audio, cdrom, etc. If you don't know,
look at what groups the dummy user is part of, and add yourself to the
same ones. Now add yourself to the new group
that you just created (whether you did so manually, or through
the Mandrake sharing tool), and change your default group to this
group (so that all files and folders you create will belong to
this group by default, rather than the "your_username" group). If you
need an individual file or folder to belong to another group, you can
change that on a per-case basis, so there's no harm in doing this.
If you're only sharing a native Linux
partition across distros, you don't need to have made a dummy user
during install, but you do need to add your regular user to the new
group you just made. Then save, exit and continue to "Editing
/etc/fstab". It's not that far away.
If you intend to share folders from
these mounted partitions across the network to a Windows box, you may
also duplicate those users on your Linux box now (using their Windows
username and password), or create a common user account for them (if
you prefer to do it that way), and add them to the new group as well. This does not actually share the
folders (that's SAMBA configuration, not covered here), but it does
ensure that you can add them easily to your sambausers list, and that
they will have proper access when the folders are shared.
OK, we're done here for the moment. Save, exit, and
on to part 2:
Editing/etc/fstab.
Why?
Because the "foreign partitions" (meaning pretty much any partition not
in a native Linux format and/or not part of the main / filesystem)
which are mounted via /etc/fstab are 1) by default mounted in places
normally accessible only to root (/mnt/something or /something) and 2)
always owned by root and the root group (unless you change that by
editing this file). This is not really useful to you, especially if you
need to share any of these mounted partitions back across the network
or commonly need read-write-execute access to the partition's contents.
So what we're going to do now is tell Linux to mount these partitions
in such a way that they are owned by you as a user under this
distribution, and so that you will retain that ownership when you mount
the same partitions under other distributions.
How?
Su to root and type "name_of_your_favorite_text_editor
/etc/fstab" (without the quotes).
Here's a common (but totally fake) /etc/fstab:
/dev/hda1 /boot ext2
noauto,noatime 1 1
/dev/hda2 none swap
sw 0 0
/dev/hda3 / ext3
noatime 0 0
/dev/cdroms/cdrom0 /mnt/cdrom
iso9660 user,noauto,ro 0 0
/dev/fd0 /mnt/floppy auto
noauto,user,sync 0 0
proc /proc proc
defaults 0 0
/dev/hdb1 /mnt/win vfat
auto,defaults 0 0
/dev/hdb5 /mnt/hdb5 ext3 noauto,users,exec 0 0
Remember
where I told you to write down the designations of your partitions?
Well, this is where it pays off.
Some distributions, like Mandrake, create an entry in /etc/fstab for
every partition found (and in fact, under Mandrake, you could have done
all this editing via DiskDrake during the
install, but for your
first time it's better to do it by hand and then feel "l33t" when you
reinstall someday and can in fact set it up during the install because
you know all the settings already ;-)).
Some distributions, like Libranet, create an entry in /etc/fstab only
for Windows partitions found (and possibly only bootable Windows
partitions, as opposed to non-bootable FAT32 partitions).
Many distributions do not create any entries in /etc/fstab beyond the
/boot, /, swap, proc, and peripherals (/cdrom and /floppy). So you have
to create entries for any other partitions yourself.
The fast explanation of how Linux
designates partitions:
Partitions (as you hopefully already know) can be either primary or logical. Logical partitions are actually subdivisions of an extended
primary partition, but they are not themselves primary.
Now, it's easy to understand that /dev(ice)/h(ard)d(rive)a indicates the first drive on your
system (meaning that it's the on primary IDE controller, as master).
But what about the numbers? Easy-- numbers 1-4 indicate primary
partitions in order of discovery (you can only have four primary
partitions on any given drive). Numbers 5 and up indicate logical
partitions in order of discovery. So in the example above "/dev/hdb1"
indicates the first primary partition on the second hard drive (meaning
that it's on the primary IDE controller as slave-- if it was on the
secondary IDE controller as master it would be designated as hdc and
you can guess what it would be called if it was on the secondary IDE
controller as slave, can't you?). If there was an entry for a FAT32 (or
any type of) partition that was the second logical partition on the
first drive, it would be /dev/hda6. And so on.
The fast explanation of fstab entries:
Each line of fstab refers to one device, on one line, in 6 sections.
Each section of each entry must be separated by a space (though a tab
is more common for readability's sake). There must be no spaces within
a section.
Now, the only lines you should be editing or creating are those
referring to mounted FAT32 partitions (or possibly limited editing of
lines referring to NTFS partitions), and those referring to any
additional ext3 partitions you may have made to hold shared Linux data.
DO NOT
EDIT THE LINES FOR /BOOT, /SWAP, / OR /PROC. EVER!!!!
(unless
you like killing your system).
The sections of a line are:
device designation/partition location
mount point
filesystem type
options
(lifted direct from the MUO
Administration guide-- you might also want to read Mounting I) The
last two options are flags for the file system utilities 'dumpe2fs' and
'fsck'.
The 'dump' field is either set to '1' (enable) or '0' (disable). Since
'dump'
is used by backup programs for the ext2 / ext3 file system only, '1' is
set
just with entries for ext2 / ext3 media. All other media use '0'.
The 'fsck' field can either be set to '0' (disable file system check),
'1'
(check first) or '2' (check). '0' is set for all media with non-Linux
file
systems, removable and networked media, and virtual file systems. '1'
is set
for the '/' entry, since this partition has to be mounted (and thus
checked)
first and '2' for all other non-removable, local media with Linux file
systems
So, since you cleverly wrote down your partition locations, you should
be able to identify the correct lines in /etc/fstab, if they exist. If
all the necessary lines do not exist (because you have more than one
FAT32/NTFS partition and only one was picked up, or the shared Linux
partition was not picked up), it is likely that one of the lines will
be fairly close so that you can select and copy it, paste it to the
bottom and edit it.
Let's get on with it:
example line 1 (FAT32):
/dev/hdb1 /mnt/win vfat auto,defaults 0 0
First thing we want to do is change that mount point to something more
useable. If you need to share anything from this partition back to the
network, it needs to be in your /home directory. I also find it more
convenient to locate such a partition there even if I don't want to
share it-- who wants to be browsing to /mnt when every file manager
known to Linux opens in your ~/ by default? Thus "/mnt/win" becomes
"/home/your_username/whatever_you_like".
Second thing we want to do is fix those options. Remember, no spaces in the options
sections-- not even after the commas!
'auto' is fine if you want the
partition auto-mounted on startup, which I would think that you do. If
you have 'supermount'
(because you use Mandrake, which uses this option by default, and/or
see it on other lines, or because you compiled your own kernel and
included it), you might want to use that instead, but opinions about
supermount vary. In either case, it's one or the other, not both
'supermount' and 'auto'. If for some reason you want to manually mount
the f(ile)s(ystem) every time you want to use it, take 'auto' or
'supermount' out.
The main thing we want to do is remove
the 'defaults' option and replace it with:
rw,uid="#",gid="#",umask=#A#B#C
"rw" is read-write. Presumably
you want this, unless the partition is NTFS (which you should not write
to from Linux, so if it is, leave it as or set it to "ro" for
read-only. Also, in the case of an NTFS partition, the 'vfat' section should read
'ntfs' instead).
"uid=#" and "gid=#" are the
important options here, available only for vfat (and other msdos-type)
partitions. This sets the uid (owner) and gid (group) to the ones you
specify with "#". Replace # with your uid and the gid of the special
group you created, and when mounted all files/directories will be owned
by you and all members of the special group will be able to access it.
How much access they have is determined by the next option:
"umask=#A#B#C". The umask
option detemines how much permission you want to strip
from the default. If you have heard of the chmod command, this is actually a
sort of backwards mirror image of the same thing that command does, but
no commands such as chmod, chown or chgrp can be used on the contents
of mounted foreign partitions once they are mounted by /etc/fstab,
either automatically or manually (I think you can use these commands if
you mount a partition manually but bypass the fstab settings, but I'm
not sure).
So to change permissions or ownership of such partitions, you must use
the umask option here in /etc/fstab.
The permissions
are indicated by a 3 digit number, the first digit representing the
owner, the second representing the group, and the third representing
"others" who are neither the owner nor members of the group. The
permissions are determined by adding together each number representing
a permission: Read is 4. Write
is 2. Execute is 1.
The default
permissions for any newly created directory are 777-- r(ead,)w(rite,)(e)x(ecute) for owner, rwx for group,
rwx for those neither owner or group members ("others"), because 4 +2+1=7. The default
permissions for a file are 666
(rw, rw, rw).
However,
you might well prefer to give group members (presumably users
over the network) less permissions than "absolutely everything", and
you might very well prefer not to give "others" (whoever they may be)
any permissions at all.
Each number in the umask subtracts that number from
the default 777. So using a umask of 022 (which is the default umask if
you don't specify one) would remove "write" permissions for both the
group and "others" resulting in a default permission of 755 (rwx,
rx,rx) for the mounted partition.. I myself use umask=007, giving full
rights to me and the group (because I trust the members of my group-- I
ought to, it's just me and my fiancé, who knows he had better
bloody well not trash my PC "by
accident" if he wants to live) and no
rights to others (770). If you only want to give rw to the group, or
maybe only read, it would be 017 (removing execute permission from the
group and all permission from others) or 037 (removing write and
execute permissions from the group, and all permissions from
others) to get a default of 760 or 740.
So, assuming that you want to automount this
partition, want to allow users to mount and unmount it, your UID is 703
and you want to give execute permissions to yourself and read-write
permissions to your group (whose GID is 368), the resulting line in
/etc/fstab would look like this:
/dev/hdb1
/home/your_username/whatever_you_like
vfat
auto,users,rw,exec,uid=703,gid=368,umask=017 0 0
When you eventually reboot (we have a couple of things yet to do before
you do that), the partition will be accessible in your home directory,
and you can share any of the folders inside the partition (or the
entire partition) via Samba and the network user will be able to access
(read) and write to it as if... it was a shared folder. Which is as it
should be.
example line 2 (ext2/3 native Linux)
/dev/hdb5
/mnt/hdb5 ext3 noauto,users,exec 0 0
By now, you should have a fair idea of what this says. "The first
logical partition on the drive set as slave on the primary IDE channel
should be mounted to /mnt/hdb5, should not be mounted automatically,
but may be mounted manually by a normal user, who may execute files
(run programs) from this drive, which does not need to be
checked/dumped at startup."
The only problem with this (other than the mount point, which is
inconvenient, and the noauto, which may not be preferable) is that,
when mounted, the files on this partition are going to be owned by
root. And ext2/3 doesn't take the "uid=" option (that's only for vfat).
However, the ext2/3 filesystem does
take the "grpid", or group id option. This is the
one that makes this all possible. Grpid
means that the mounted partition inherits
the permissions of the group owning the mount point folder.
So if the group you created earlier, added yourself to, and set as your
default group, owns the mount point you're going to make very soon in
your ${HOME} (which it will, because it's your default group), and that
group has rwx permissions to that folder (which it should, but that's
easily fixed if not), then you, o user, will have rwx permissions to
all files and folders within that partition even
though root still owns it.
It's beautiful. I looooove Linux. You can do
almost anything you can think of. Before I started trying to create the
Massive Multiboot, I thought that sharing a native partition across
distros might well be impossible, especially since I had no idea how to
do it. But that's why you should read your man(ual) pages, because
that's where I found this (man fstab). And how great is it to know that
I had this crazy idea (the same one you've had, or I wouldn't be
writing this) and the
OS supports you! It's
already got a setting to enable your crazy idea to work without a hitch. It's truly
wonderful.
So our second example line becomes:
/dev/hdb5
/home/your_username/something_I_can_live_with_better_than_mnt
ext3 auto,users,exec,grpid
0 0
Are we done?
Not quite-- we need to make those mount points and delete the dummy
user. Save fstab, exit the text
editor and terminal, log out and log back in as your regular user. Head
over to your /home directory (not far to go, since you'll be there as
soon as you open a file manager) and create the necessary folders.
Check their properties after creation and confirm the group ownership
and permissions. Then fire up your User Management tool and delete the
dummy user.
Now you're done... for this distro. Now,
reboot, and you should have a choice of all available
distributions/OSes (since we fixed the bootloader so long ago). You can
boot into the distro you just left, to see how nice your /etc/fstab
works, or you can boot into another, to set that one up. Let's do
that...
Setting up the other distros
The procedure is basically the same, except
that when creating the new "real regular" user and "special sharing"
group, use the
same UID and GID as on the first distro. There
should be an option to specify this via an "advanced" button or right
on the creation screen. This will prevent the dreaded "Owner: 468"
property sheet entry (if you've created files or folders under the
other distro, they are then associated with the UID of the creator. If
this UID is not associated with a username when the partition is
mounted under a different distribution, Linux will display the
(invalid) UID rather than a username. If the GID is the same, and the
group has rwx, you'll still be able to use the files, but it's ugly and
annoying. IMHO.
It also means less numbers to remember when setting further
distributions up if your Multiboot gets even more Massive (there's a
lot of delicious distros out there, you might well want to "try them
all!").
Last but
not least (or, Shared Linux files)
Not much to say here; just a couple of notes. Like I said, since
Firebird (for example) is an "extractable" rather than an "installable"
you can easily extract it to the shared Linux partition so that you
only need to have it once. However your user profile will remain in a
hidden directory in your home folder. So two things: 1. install any
extensions to your profile rather than the program directory (most if
not all extensions allow you to choose) and 2) backup your
bookmarks.html from the profile folder on the distro you use most often
to the shared partition and use it to overwrite the others to keep your
bookmarks roughly conformed when you boot into another distro. Yes,
it's dirty, but it could be much worse. This goes for Mozilla as well.
Sharing a Mail folder under all distros
using Mozilla or Thunderbird
This is extremely easy, and in fact works both
cross-distro and between Linux and Windows (if the shared mail is kept
on a FAT32 partition). Open MozMail or Thunderbird. You will be
prompted to make a profile. Do that normally, but do
not let it download your mail(uncheck the "Download Mail Now"
box on the final creation screen. Yeah, OK, it still wouldn't download
it without the password, but I like to be safe. I've moved all the way
to another country and still have all my mail, so...just trust me ;-)).
In your file manager, create a folder in the shared Linux partition, or
shared FAT32 partition if you want to use the same mail folder under
Windows.
Interlude: If you
already use MozMail or T-bird under Windows and want to share the mail
you currently have, then you will need to move the mail folder located
in "C (or whatever drive you keep Windows on):\ Documents and
Settings\your_username\Application Data\Mozilla (or Thunderbird,
whichever)\profiles\your default profile (whatever it's called if
you've made more than one)\random string of 8 numbers and
letters\Mail\folder named the same as your incoming mail server. Move "
folder named the same
as your incoming mail server" in its entirety to
the shared folder you created if youknow
you've turned off
"Download mail on startup", which is turned on by default in
both Moz and T-bird. If you have not
turned this option off under Windows, reboot and do so before
moving the Mail folder (otherwise
one batch of mail will be automatically downloaded to a folder that no
longer exists when you open MozMail/T-bird to change the folder
location... which would be bad). If
you use Mozilla, you should also export your address book to ldif
before moving the mail folder, so you can import it into the various
profiles of either Mozilla or Thunderbird under the various distros.
Nothing more annoying than not having your nicknames installed when
you're trying to dash off a quick email. End interlude.
For all versions of Mozilla and T-Bird (both Linux and Windows), go to
"Mail and Account Settings"
(in MozMail under the Edit menu, in T-bird under the Tools menu). Under
the "Server Settings" section, at the very bottom of the dialog, is the
"Local Directory" setting. Change this from the default to point to the
folder on the shared partition (type in the complete path). Now close
and restart Thunderbird, or close Mozilla completely and reopen it, and
then the Mail component (if you don't start MozMail with the -mail
switch).
MozMail/T-bird will ask for your password (because it likes to
download mail on startup). If this is a completely new mail collection
(you aren't conforming with previously downloaded mail), then go ahead.
If you moved a Windows mail folder, imported mail from another mail
client or basically did anything that means there should be old mail
displayed, cancel and check to make sure that the old mail is in fact
displayed properly before adding new downloaded mail to it.
This sounds very complex, but it's really not, and the best thing is
that if you create mail filters under any distribution, the fact that
the mail folder is pooled means that they will work without a hitch
(well, without any more of a hitch than MozMail and T-Bird usually
have, which isn't much) under all distros (and Windows).
OK,
that's really it. Sorry it's so terribly long and
unpretty, but I hope it helps those of you wanting to set up a Massive
(or Not-So-Massive) Multiboot Linux system.
Have fun!
©2003 Holly Bostick (motub).
|
 |
 |
 
 |
 |
|
| |
 |
 |
 |
 |
 |
 |
ravi
Hi West - I did a while back, if it's a recent one - I haven't been checking regularly. My flat's been totally flooded from a burst pipe - so life is a bit disrutped at the moment.
03 Nov/14:18
West
Hey Ravi, did you get my email?
27 Oct/02:02
Ravi
PS Chatbox currently functional.
14 Oct/00:02
Ravi
Phew - that took a while, but all's well now. Sorry for the hiatus folks.
13 Oct/23:56
ravi
I think I'll implement a "keyword" for this site, so you'll have to start your comment with ... say "shells" ... I'll strip that and post your comment.
Hopefully that will keep the spammers at bay.
24 Mar/19:04
ravi
gv, you naughty boy you.
24 Mar/19:02
ravi
Ah, I see neither gv nor the spammers fell for it.
gv - you do realise that now I'm going to delete the spam and you'll look crazy don't you?
23 Mar/12:20
gv
spears naked what?
23 Mar/10:50
gv
Just testing ;)
22 Mar/10:37
ravi
I'm going to disable the chatbox and comments until I have some time to deal with the comment spam. Meanwhile contact me at: [ link] if you'd like to post a comment.
21 Mar/17:01
sheep
what is the best shell replacment to use if you want security for liek a public desktop e-mail me at [ email]
14 Mar/11:42
gv
It's called emerge desktop now and its available at [ link]
09 Mar/09:35
 |
 |
 |
 |
|