LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Putting /home on a different harddisk? (https://www.linuxquestions.org/questions/linux-newbie-8/putting-home-on-a-different-harddisk-371472/)

Swakoo 10-10-2005 06:07 AM

Putting /home on a different harddisk?
 
I am trying to setup a ftp server for some of my guys

i have a simple server with 2 harddisk... (20GB-hda and 80GB-hdd)

I set it such that its

hda1: /boot 100MB
hda2: /var 10GB
hda3: swap 1GB
hda5: /tmp 1GB
hda6: / 7.5GB

hdd1: /home 80GB


As you can see, I put the /home (where the user log in and put their files) in another dedicated harddisk...

1) is this an advisable setup?

2) Should mine 20GB fail (where the OS mumbo jumbo are loitering), how do I install a new set of OS (with new hdd of cos) but at the same time, re-using (or remounting) /home on the 2nd harddisk without over writing data. is it even possible?

Thanks!

blindcoder 10-10-2005 07:12 AM

Yes, this is a sane thing to do if you have the space harddisk.

Most installers allow the use of existing filesystems as mountpoint. However, it is not always advisable to do this.
What I suggest is this:
open the file /etc/fstab in a text editor. Go to the line that contains "/home". Copy, print or remember that line until the next reinstallation.
After the next reinstallation, just paste that line into /etc/fstab again and you're done.

HTH,
Benjamin

dasy2k1 10-10-2005 10:48 AM

i have heard that /boot must be on the same partition as / for the system to boot corectly as it is data in this folder that can determine how partitions are mounted
and if it is on its own partition then it cnat tell itself to mount untill its mounted, kinda catch 22


has anyone managed to get a stable system with /boot on a seperate partition?

tuxrules 10-10-2005 11:03 AM

Quote:

has anyone managed to get a stable system with /boot on a seperate partition?
Do you mean separate disk or separate partition? I always use a separate partition for /boot.
Here's my current disk config:

/boot - hda1 100 MB
/ - hda2 15 GB
swap - hda3 1 GB
/home - hda5 - 60 GB

And as far as I know you can configure and boot a system located on a another disk via a centralized grub in /boot partition...I don't think it should be a problem. All grub (which I use) cares is the disk geometry. You would be able to boot as long as grub has right partition geometry and points to the right kernel and initrd (if present).

Tux,

blindcoder 10-10-2005 02:15 PM

Quote:

Originally posted by dasy2k1
[B]i have heard that /boot must be on the same partition as / for the system to boot corectly as it is data in this folder that can determine how partitions are mounted
and if it is on its own partition then it cnat tell itself to mount untill its mounted, kinda catch 22
I don't know who told you that but either that person has totally outdated information or is just talking nonsense.
I have only a single machine where /boot is NOT on its own partition and so far never had a single problem.

Greetings,
Benjamin

Swakoo 10-10-2005 09:23 PM

Quote:

Originally posted by blindcoder
Yes, this is a sane thing to do if you have the space harddisk.

Most installers allow the use of existing filesystems as mountpoint. However, it is not always advisable to do this.
What I suggest is this:
open the file /etc/fstab in a text editor. Go to the line that contains "/home". Copy, print or remember that line until the next reinstallation.
After the next reinstallation, just paste that line into /etc/fstab again and you're done.

HTH,
Benjamin



My fstab is as follows:
Quote:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
/dev/devpts /dev/pts devpts gid=5,mode=620 0 0
/dev/shm /dev/shm tmpfs defaults 0 0
LABEL=/home /home ext3 defaults 1 2
/dev/proc /proc proc defaults 0 0
/dev/sys /sys sysfs defaults 0 0
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/var «m\]Ãà swap ext3 swap defaults 1 2 0 0
/dev/fd0óÃïüä^Oà /media/floppy auto pamconsole,exec,noauto,managed 0 0
/dev/hdc /media/cdrom auto pamconsole,exec,noauto,managed 0 0

So what you mean is I just have to copy the line (highlighted in bold) and paste in into the new installation of fstab so as to be able to access it?
Then while installing, what do I specify for the /home?


Another thing just came to my mind; should I want to take this /home partition (the entire hdd btw) to another server and use it.. do I mount it the same way, edit the fstab?

J.W. 10-11-2005 01:28 AM

If you've defined the 80G drive as a single partition (specifically, /home) and you wish to either install a different distro onto the 20G drive or physically remove the 80G drive a move it to another Linux box, then all you'd need to do would be a _similar_ line to the new fstab. The fstab entry wouldn't necessarily be exactly the same, because different distros may use slightly different naming conventions for fstab, and if you move a drive from one place to another, it may be in a different location than it was previously (eg, it may have been the primary slave (/dev/hdb) position, but in the new machine it is in the secondary slave (/dev/hdd) position).

Overall though putting /home on a separate partition is an excellent idea. If you are reinstalling a distro and/or moving the drive, really the only thing you need to be careful about is to NOT reformat that partition, otherwise you'll lose all that data. -- J.W.

Swakoo 10-11-2005 01:38 AM

oh i see.. i just need to specify in fstab the location (hba, hdd etc) ...

I didn't know its so straight forward, just by pointing the fstab to the how the harddisk connected via the motherboard will allow the OS to find... but what are the naming convention for primary master, pri slave, sec master, sec slave...?

so during a fresh installation of the os distro on the 20GB, I just don specify /home as an individual partition i suppose?

after editing fstab, what do i need to restart to get it active?

say if i need to backup my 80gb (/home) data, i copied them out..
is it possible to format the harddisk to ext3 and then copy the data back in (say i store it in another server via network connection). am i able to do it via linux?

blindcoder 10-11-2005 02:14 AM

Quote:

Originally posted by Swakoo

I didn't know its so straight forward, just by pointing the fstab to the how the harddisk connected via the motherboard will allow the OS to find... but what are the naming convention for primary master, pri slave, sec master, sec slave...?

The naming convention comes from the kernel and should be usable across all distributions:
Primary Master: /dev/hda
Primary Slave: /dev/hdb
Secondary Master: /dev/hdc
Secondary Slave: /dev/hdd
If you have a PCI IDE Controller that will continue to hde, hdf, hdg, hdh and so on.

Quote:


so during a fresh installation of the os distro on the 20GB, I just don specify /home as an individual partition i suppose?

correct

Quote:


after editing fstab, what do i need to restart to get it active?

Nothing. /etc/fstab is read directly by mount so the information is immediately available after you leave your text editor.

Quote:


say if i need to backup my 80gb (/home) data, i copied them out..
is it possible to format the harddisk to ext3 and then copy the data back in (say i store it in another server via network connection). am i able to do it via linux?

Of course. For the network backup you can use anything from an FTP server, a Windows shared folder, an NFS share on a UNIX machine or anything else like that.

HTH,
Benjamin

Swakoo 10-27-2005 04:35 AM

hi guys, abit confused... better thought i clarify

I've quoted my entire fstab a few post up :rolleyes:

with the following line in particular
LABEL=/home /home ext3 defaults 1 2

My fstab doesn't mention anything abt /hda, /hdb, /hdc, /hdd...

so when i want to move my 80GB to another machine, i just copy the above line will do? Where do I specify it is primary/secondary master/slave ?

What does '1' '2' refers to..?
i suppose defaults is refering to group..? cos i am playing with group quota now :) learning how to set...

please advice (again)

thanks


All times are GMT -5. The time now is 02:09 AM.