LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Multiple Hard disks on same server (https://www.linuxquestions.org/questions/linux-server-73/multiple-hard-disks-on-same-server-4175464870/)

manuel19 06-05-2013 02:35 PM

Multiple Hard disks on same server
 
In my server I have 2 hard disk.

- 1st have 10GB.
- 2nd have 500GB.

The Linux fedora is installed in the 1st hard disk.
the 2nd is 100% new and don't have any data on it.

I want to know how can I do this:
Install softwares, scripts,etc,etc BUT in the 2nd hard disk ONLY.

I want to keep the 1st ONLY to hold the Linux system. I want to never change anything on 1st hard disk.


How can I do that?

jlinkels 06-05-2013 03:43 PM

Create partitions on the second disk. Mount the partitions on the directory tree where you need them.

For example, create a 100 GB partition on disk 2. Mount the partition as /home under '/' on the first disk.

You can do that automatically by specifying this in the /etc/fstab.

When you have mounted /home this way, if there was a /home partion on disk1, you will not be able to see or use it as long as the /home on disk2 is mounted.

You can also mount partitions further down in the hierarchy, say /home/foo from disk2 under /home on disk1. The same goes for directories like /usr/local.

jlinkels

Cyberman 06-05-2013 06:13 PM

I have my entire system on the larger disk, and I use the smaller disk for a backup, because I believe that the /home folder is the most important folder to backup, whereas anything else is freeware and easily replaceable. I do not know what your plans are, but I think you may want to consider your storage space more wisely.

jefro 06-05-2013 08:44 PM

There are also other ways to add storage.

One might be to attach the extra space with some unique filesystem. zfs and btrfs come to mind but other ideas like lvm might work.

Also one might attach the entire drive to some folder or as above move or link the current folders to the extra space.

Guess you could do like a live cd does. Make an aufs to attach extra space.

The normal way is to consider moving or using/mounting the commonly changed folders to the new disk.

Without going to some live cd sort of deal, you can't simply change permissions to read only and expect it to work. So some data might change.

sundialsvcs 06-05-2013 10:17 PM

As an aside ... when you start installing multiple (big) hard drives, you probably want to seriously consider introducing a Logical Volume Manager (LVM) system, which creates the important notion of "storage pools."

Under an LVM arrangement, a "mount point," such as, say, /usr, no longer has a one-to-one correspondence with "a disk drive (partition)." Instead, the mount-point is associated with a "storage pool," which is represented by available space on one or more physical drives. (Furthermore, this space-allocation can be adjusted.)

The "mount points" become a logical view of the storage, now fully independent of the physical reality (of the present moment), as represented by the (present...) arrangement of the storage pools. Programs see only the logical view of things: they "know nothing, and care nothing," about exactly how their needs are actually met. (And, after all, why should they?) :)

It's a very liberating concept, and well-implemented. You probably should look into it.


All times are GMT -5. The time now is 10:20 PM.