Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

I really should know this but.....

  • 03-04-2003 3:08pm
    #1
    Closed Accounts Posts: 304 ✭✭


    Right I'm just wondering, I've a RH 7.3 box acting as a kind of fileserver with a huge number of files sitting in one directory - let's call it /var/share/webs

    Now there are a number of files in /var/share/webs, and a number of subdirectories. Fairly soon HD space on the machine is gonig to be severly decreased, so I'll probably need to get a second drive.

    Now my question is can I mount the new drive at /var/share/webs directly thereby effectively (and transparently) increasing the amount of free space available in /var/share/webs? (so one directory spans the two drives). If so how can I specify that all new files physically go to the second drive instead of the first?

    Would I just be better mounting the new drive somewhere else and symlinking all the old files to the new location and moving my apps to point to the new location?


Comments

  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    The only fs type that does automagic file mirroring is RAID.
    So unless you are going to do some sort of RAID in /var/wherever for your files .... it won't work that way.

    If I mount /dev/hda10 at /mnt then the contents of /dev/hda10 appear in /mnt as opposed to the contents of /mnt being transferred to /dev/hda10 (which is as we want it really... if you think about it).

    So, what "I" would do is.

    mount /dev/hdb1 /mnt -- assuming hdb1 is the new drive

    cp -r /var/share/webs /mnt

    then edit /etc/fstab to mount /dev/hdb1 /var/share/webs

    then rm -rf /var/share/webs

    and reboot...

    /dev/hdb1 should now be at /var/share/webs... and all should be seamlessly 'right' with the universe.


  • Registered Users, Registered Users 2 Posts: 795 ✭✭✭a_ominous


    I'd agree with what Typedef said. The reboot isn't strictly necessary, but it will reassure you that the system will mount the filesystems properly. You should just be able to run

    $ mount -a

    One thing to bear in mind with IDE drives is the hardware limit of 2 devices per cable. So with your current HDD and a CD-ROM, you're probably alright. But are there other HDDs?

    You don't mention what type of box you are using. If it's an old desktop reassigned to file server duties, you might need to add an IDE controller card. Or a Serial ATA card. The Serial ATA cables will allow better airflow than the standard IDE cables. And it gives you a chance to play with some new technology. Some of the Promise Serial ATA cards do allow RAID if you're interested, but that might lead you into looking at having hot swap drive casings...

    -ao-


  • Closed Accounts Posts: 304 ✭✭Zaltais


    Thanks for that Typedef, but in actuality I don't really want to copy the files across from one drive to another as the current drive is 40GB with about 5GB free at the moment. If I get an additional 80GB or thereabout's and copy everything across, then I'm going to have half of that lovely 80GB wiped off the face of the planet with about 30GB free on the old drive gathering dust....

    Hence my final point about symlinks :-

    So then if I were then to do:
    mount /dev/hdb1 /var/share/new_location

    and symlink the contents of /var/share/webs to /var/share/new_location

    so /var/share/webs/file1 is linked to /var/share/new_location/file1

    and so on - I think I'd have what I want, but I'd have to repoint my apps to use /var/share/new_location - which is not really a big deal, but a few hours extra work....

    So if I do this, how much space does a symlink actually take up?


  • Registered Users, Registered Users 2 Posts: 795 ✭✭✭a_ominous


    Symlink only takes as much space as characters in the pathname. For instance:

    ln -s /var/share/new_location /var/share/webs
    will use 23 bytes. well in reality 1 K or whatever the sector size is.

    In order to use the space in /var/share/webs, you will need to repartition the disk. So a backup first will be necessary. Or do you feel lucky ;) ?

    Or you could partition the new bigger disk, copy all but the /var/share/webs files to the new disk and change your fstabs? Mounting /var/share/fstabs on /dev/hdb1a.
    It depends on how quickly your webs directory grows.


  • Closed Accounts Posts: 304 ✭✭Zaltais


    Hi a_ominous,

    Yep it's an old desktop acting as a kind of fileserver / webserver jobbie...

    There's only one HD and a CD-ROM in there at the moment but there are two controllers afaik - I may look into Serial ATA anyway for the speed increase (and the 'new toy' factor of course), but I'm nearly sure I've enough space for at least 2 new IDE drives as it stands....

    Not all that interested in RAID atm, these are fairly static reference documents so once I've a weekly backup onto tape I'm unlikely to loose anything critical.

    The actual growth rate tends to be in spurts, so nothing will happen for ages, then there'll be another 5 or 10 gigs added in a couple of days.....


    Thanks for all your help on this guys!


  • Advertisement
  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    Thanks for that Typedef, but in actuality I don't really want to copy the files across from one drive to another as the current drive is 40GB with about 5GB free at the moment. If I get an additional 80GB or thereabout's and copy everything across, then I'm going to have half of that lovely 80GB wiped off the face of the planet with about 30GB free on the old drive gathering dust....


    Err, perhaps I'm missing your point, but, if you symlink all of the files in the current /var/share/web to files in /var/share/new_location... where new_location is the mount point of the second hard disk... the net effect will be that you will 'still' have your old files residing on the new hard disk... but with symlinks from the old directory to the new... which is a waste of time and effort on your part.

    Plus some applications my not like following symlinks.

    so linking /var/share/webs/new_location/someconf.conf /var/share/webs/someconf.conf in place of the original file /var/share/webs/someconf.conf is (a) going to be difficult if you have lots of files (b) a pain in the hole for applications that don't follow symlinks (c) going to be defunct because you still end up with your old files on the new hard disk.

    If you mount the new hard disk at /var/share/webs you "don't" have to endure the tedium of symlinking your current files and the associated issues that go with symlinks.


  • Closed Accounts Posts: 304 ✭✭Zaltais


    Err, perhaps I'm missing your point, but, if you symlink all of the files in the current /var/share/web to files in /var/share/new_location... where new_location is the mount point of the second hard disk... the net effect will be that you will 'still' have your old files residing on the new hard disk... but with symlinks from the old directory to the new... which is a waste of time and effort on your part.

    Right now maybe I in turn am missing your point but my idea was to leave the old docs on hda (/var/share/webs) and symlink them to hdb (/var/share/new_location) so the files will still be physically on hda but acessible by going to hdb (/var/share/new_location)
    so linking /var/share/webs/new_location/someconf.conf /var/share/webs/someconf.conf in place of the original file /var/share/webs/someconf.conf is (a) going to be difficult if you have lots of files (b) a pain in the hole for applications that don't follow symlinks (c) going to be defunct because you still end up with your old files on the new hard disk.

    (a) There are a huge number of files, but most will be in subdirs, so I'll be symlinking a few directories rather than the thousands of files. (b) The apps will follow symlinks - it'll really be more of a glorified ftp server type thing and I have checked this out already. (c) now here I'm confused because I was thinking I'd have the convienience of using the free space on both drives, but only having to access them in the one location.
    If you mount the new hard disk at /var/share/webs you "don't" have to endure the tedium of symlinking your current files and the associated issues that go with symlinks.

    Yes, but I loose a huge amount of free space in the process. Which I'm going to need ti use at some stage, so I reckoned it'd be better to do it now while I getting a new drive, rather than just copying everything piecemeal and having the same problem in a couple of months...

    Mind you that said I could just try and get the company to fork out for a 200 GB drive and take the 40GB out altogether - but then they are a pack of tight fisted b@st@rds....


  • Closed Accounts Posts: 84 ✭✭ironape


    woult it not just be easier to mount the new disk under the old space, eg.

    /usr/share/webs is your old stuff

    make a directory /usr/share/webs/extra and mount the new disk on that and just put your new stuff in there ? rather than all that linking?

    just a thought. unless the files *need* to be in the same dir?

    Ape


  • Closed Accounts Posts: 304 ✭✭Zaltais


    Yep, it'd be a damn site easier, but unfortunately for the most part the files *do* need to be in the same dir as they'll be categorised according to subject......

    So I can't really have set of dirs along the lines of:

    /var/share/webs/europe
    /var/share/webs/america
    /var/share/web/extra/asia
    /var/share/web/extra/australia

    etc.

    Cos people will be too stupid to find the stuff.

    My motto is generally "Never underestimate the stupidity of the average person"


Advertisement