LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-11-2008, 11:16 PM   #1
ashlyjay
Member
 
Registered: Dec 2006
Posts: 32

Rep: Reputation: 16
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 ?
 
Old 09-12-2008, 02:21 AM   #2
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Rep: Reputation: 40
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.
 
Old 09-12-2008, 08:38 PM   #3
ashlyjay
Member
 
Registered: Dec 2006
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by kenneho View Post
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?
 
Old 09-12-2008, 09:30 PM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
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.
 
Old 09-12-2008, 11:24 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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

Last edited by John VV; 09-12-2008 at 11:27 PM.
 
Old 09-13-2008, 12:50 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by John VV View Post
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 View Post
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.

Last edited by i92guboj; 09-13-2008 at 12:51 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Make removable USB hdd mount at fixed mount point ctkroeker Linux - General 13 08-11-2009 09:49 AM
Moving /var or /home to another HDD martinezjr Linux - Hardware 2 09-05-2008 08:52 PM
No error display at /var/log/messages when HDD of RAID & 1of 2 hotplug power unplug arikyeoh Linux - Hardware 1 07-27-2007 03:26 PM
How to format & mount 2nd hdd after FedCor1 has been installed on 1st hdd? clay394 Fedora 1 05-18-2004 02:50 PM
moving /var to a new hdd freelinuxcpp Linux - Software 4 11-02-2003 03:52 AM


All times are GMT -5. The time now is 08:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration