LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mount new HDD on /var (https://www.linuxquestions.org/questions/linux-newbie-8/mount-new-hdd-on-var-669369/)

ashlyjay 09-11-2008 10:16 PM

mount new HDD on /var
 
Good day guyd,

SLES 9.0
2x SCSI 146GB ( Raid 0 )

I will be planing to add a 2 HDD drive to my ibm server. What I would to do is that I would like to mount all my free space of my new HDD to my /var folder. I don't know if this is possible. Can you help me ?

kenneho 09-12-2008 01:21 AM

You can connect your drive, partition it, make filesystem (for example ext3), and mount it to /var. Make sure you use /etc/fstab for mounting.

As your /var folder most likely is not empty you can rename /var to /var.old, make folder /var, mount the new drive into /var, and copy the files from /var.old to /var, and delete /var.old .

You may want to do this in single user mode.

Hope this was of some help.

ashlyjay 09-12-2008 07:38 PM

Quote:

Originally Posted by kenneho (Post 3278029)
You can connect your drive, partition it, make filesystem (for example ext3), and mount it to /var. Make sure you use /etc/fstab for mounting.

As your /var folder most likely is not empty you can rename /var to /var.old, make folder /var, mount the new drive into /var, and copy the files from /var.old to /var, and delete /var.old .

You may want to do this in single user mode.

Hope this was of some help.

I have a groupwise email installed in my /var folder. If im going to rename my folder to /var.old and mount my new hardrive to /var...will my email will still be the same?i mean is there a possibility that my email will be corrupted?

jay73 09-12-2008 08:30 PM

Before you do anythin else, copy the contents of your var folder to the new drive using cp -vax *. Make sure to do this from a livecd/dvd. Then mv your /var to /var_bak (or whatever you prefer to name it) and create a line for var in your fstab.

John VV 09-12-2008 10:24 PM

just take the easy way and use

/mnt/( name for drive)
and add /mnt/??? to fstab
why dose it have to be /var
also mounting a drive or partition to / is not a good idea ,for it must have the same permissions as / .And if selinux is installed it will through a fit until you mount it someplace else

i92guboj 09-12-2008 11:50 PM

Quote:

Originally Posted by John VV (Post 3278905)
just take the easy way and use

/mnt/( name for drive)
and add /mnt/??? to fstab
why dose it have to be /var

Probably because he needs extra space under that directory, or just because the data there is important and he wants to separate it from the rest of the system, or just use a different filesystem for performance purposes. The list of possibilities is much longer. In any case, it's not an strange thing in servers, nor even in desktops.


Quote:

Originally Posted by ashlyjay (Post 3278813)
I have a groupwise email installed in my /var folder. If im going to rename my folder to /var.old and mount my new hardrive to /var...will my email will still be the same?i mean is there a possibility that my email will be corrupted?

jay37 told you the correct way. Boot a livecd, mount the partition containing your actual /var, and mount your new disk, copy all the stuff from your var to the new disk, then rename var to var_old or whatever.

After that, change fstab, so your new disk is mounted on /var.

After that, reboot, and you should have your new drive mounted without any pain.

As said, make sure you use -a or equivalent options when copying. If you mess up the permissions you are going into serious trouble.

The livecd step is needed because it's not a good idea to manipulate live partitions that might change at any time. You might end with uselss broken backups and you will have trouble to umount and mount it.


All times are GMT -5. The time now is 12:30 AM.