At 09:46 AM 4/2/01 +0300, Spyros Ioakim wrote:
>i want to expand the capacity of two directories by adding a second
>hard disk.
>
>i want to add capacity to the following directories
>/home/atlas/ftp/
>/samba/public/
>
>is it possible to mount the disk under two directories?
Yes.
>mount /dev/hdb1 /samba/public
>would mount the disk under /samba/public but then i wouldn't
>be able to use it under /home/atlas/ftp/
Mostly true.
>what happens if i create two directories on the new hard disk
>/home/atlas/ftp/ and /samba/public/ and mount it under /
>will that work or is it insanse?
You would mount the drive as your root partition (on top of your current
root partition) and the entire contents of your old drive would be
invisible. You would now appear to have a system which only has the
directories /home/atlas/ftp and /samba/public and nothing else (since this
includes no binaries, you would also not be able to un-mount the disk
afterwards I suspect).
There are several things you can do to achieve the effect you appear to
want (splitting the space between these two dirs):
If you're willing to split the drive up:
Create two partitions (hdb1 and hdb2), make ext2 filesystems on both of
them and then mount one of these on each dir.
If the content of these directories is temporary/unimportant files:
Create one big swap partition on the drive, then compile your kernel
(version 2.4) with tmpfs support, and make tmpfs mountpoints at each of the
two dirs. They will simply expand into swap space as needed, but their
contents will be lost whenever you reboot or unmount them. This will
probably not be of any use for you, but it's a good way to setup thinks
like your /tmp and /var/tmp dirs, as well as squid and browser caches.
If you're willing to complicate matters:
Make a single big partition on the disk, mount it as something like
/mnt/foo and make directories /mnt/foo/atlas and /mnt/foo/public. Then move
the contents of the current atlas and public dirs into these new
directories, remove the old dirs entirely, and replace them with symbolic
links to the ones under mount (e.g. "ln -s /mnt/foo/public /samba/public")
and make sure you have the appropriate permissions set on /mnt /mnt/foo and
so on so that your samba users can actually follow this link. Also make
sure that your smb.conf file is written so as to make Samba handle symlinks
transparently (similarly you will need to make sure that your ftp server
isn't chrooted when accessing /home/atlas/ftp).
If you're willing to work a bit for a really slick solution:
Backup your current filesystems and convert your disks into a software
RAID-0 device. If you have them on separate controllers this will not only
let you access them both as though they were one big disk, it will also
give you up to double your current access speed (read/write throughput that
is).
If you're willing to work a bit harder for the best solution available:
This one may actually be somewhat easier than the above because, in
theory, you could do it without doing a full system backup first. First
upgrade to kernel 2.4. I recommend using the rpms from Redhat's rawhide
distro rather than compiling all this stuff yourself (which would make it
difficult to upgrade stuff with RPM later) making sure you install the
kernel-source package. Now compile yourself a kernel with LVM support, read
the LVM how-too, create a large logical volume using your new disk, move
your existing filesystems onto it, set it up as your root device (you will
probably also need to create a separate ordinary partition of 20mb or so to
mount as /boot, I'm not sure if lilo supports booting off of an LVM device
yet) and then reboot using the logical volume as root. You can now
re-partition your old drive(s) (which you are no longer using) and convert
them into physical extents which you can then use to expand your logical
volume(s). This would let you distribute your disk space wherever you
wanted, and re-distribute it pretty much at will, independently of the
actual physical characteristics of your disks.
--
if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
printf("Don't Panic!\n");
exit(42);
}
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list