LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Multiplle hard disks (https://www.linuxquestions.org/questions/linux-newbie-8/multiplle-hard-disks-234729/)

APRESTOUS 09-24-2004 09:38 AM

Multiplle hard disks
 
I have few hard disks installed on Linux machine ( Fedora 2 )

The main idea is to run Samba server and to give to LAN ( Windows desktops ) access to it.

What is the best way to organise it that the multiple disks would look for the network users like one big directory?

I feel it is possible, but my knowledge is too short.:(

slano 09-24-2004 09:57 AM

for example if you have two disks do this:

Code:

mkdir /mnt/share/disk1
mkdir /mnt/share/disk2

mount /dev/hdax /mnt/share/diskX
mount /dev/hdbx /mnt/share/diskX

and share the folder /mnt/share with samba. if you don't like that there are two directories in this share, (one per each disk) you can use software RAID to "make multiple disks behave like one" :) there is a plenty of documentation written on this so just use google

crabboy 09-24-2004 10:00 AM

You can use the Logical Volume manager to create a volume group that spans multiple physical devices. Then you create one or more logical volumes in the volume group and create filesystems on the logical volumes.

Confused?

Let's say you have two physical hard drives hd1 and hd2. Through the LVM software you create a single volume group and assign both drives to it. Now that volume group has the capicity of both disks. To create filesystems with all the disk space, you create a local volume and tell it how much of the vg's disk space you want to allocate to it. Finally you create you reiserfs or ext3 or whatever filesystem on the lv and mount it.

Walla... you have one huge filesystem.

Point your windows users to it via your samba conifg and you are done.


Formally the Sistina HOW-TO doc, very good:

http://www.tldp.org/HOWTO/LVM-HOWTO/

I use the LVM on pretty much every machine that I put Linux on. It allows me to grow and shrink filesystems very easily.

APRESTOUS 09-24-2004 10:16 AM

Thank you for prompt reaction.

I was already so far that tried to

vgcreate big_share /dev/hda3 /dev/hdb1

but get :

No physical volume label read from /dev/hda3
/dev/hda3 not identified as an existing physical volume
Unable to add physical volume '/dev/hda3' to volume group 'big_share'.

Does it mean that I can't use partition but only the hole disk?

crabboy 09-24-2004 10:38 AM

Yes you can use one or more partitions as well as the whole disk. You need to initialize the disk for the LVM first.

http://www.tldp.org/HOWTO/LVM-HOWTO/initdisks.html

Note that my steps below are just a brief summary. You should take a look at the howto while setting it up.

APRESTOUS 09-24-2004 10:49 AM

I read in howto:

DANGEROUS
The following commands will destroy the partition table on the disk being operated on. Be very sure it is the correct disk.

# dd if=/dev/zero of=/dev/diskname bs=1k count=1
# blockdev --rereadpt /dev/diskname


and my hand begin shaking :)

Doesn't pvcreate destroy partition table? And data?

APRESTOUS 09-24-2004 11:00 AM

OK,

I did:

pvcreate /dev/hda3
No physical volume label read from /dev/hda3
Physical volume "/dev/hda3" successfully created

then:

pvcreate /dev/hdb1
No physical volume label read from /dev/hdb1
Physical volume "/dev/hdb1" successfully created

But still:

vgcreate big_share /dev/hda3 /dev/hdb1
No physical volume label read from /dev/hda3
/dev/hda3 not identified as an existing physical volume
Unable to add physical volume '/dev/hda3' to volume group 'big_share'.

crabboy 09-24-2004 11:04 AM

Did you get an error doing the pvcreate? If not then don't run the dd.

Yes the pvcreate will destroy data in the partiition you specify. If you speifcy a drive it _will_ modify the partitiion table and destroy the data.

You will have to mark your partitions that you want to use with the LVM as LVM partition through your partition manager like cfdisk. Type 8E

I was under the impression that these disks were not used and clean. If you in fact to have data on the disks, then it is still possible to move the entire set to the LVM parts at a time. You would need at least 50% free disk space.

crabboy 09-24-2004 11:06 AM

Label the partitions as LVM in cfdisk and save the partition table. reboot.

APRESTOUS 09-24-2004 11:29 AM

Too late :(

Now I have problems.

I can still boot system.

And there is some .iso file created which is 112 Gb of size and hopefully keeps my data.
The question is now how to get it back?

APRESTOUS 09-24-2004 11:32 AM

It is 112 Mb

crabboy 09-24-2004 12:11 PM

Uh-oh. Not good.

Explain to me what you had before on these paritions, file system types, mount points, etc... Also what exactly you did to these paritions. Was it the pvcreate or cfdisk that screwed it up. Do you get any boot errors?

APRESTOUS 09-24-2004 12:36 PM

I'm now away from the location of the computer.

there were 2 hardisks
disk A:
hda1 - system
hda2 - swap
hda3 - storage

and disk B:
hdb1 - storage

hda3 is mounted to /
hdb1 was mounted as I can remember to /home/product/

I did only pvcreate and vgcreate ( see my previous post ) , no cfdisk

After a while system hanged, after reboot gave error message and I could login as root when prompt was something like
Restore 28#

crabboy 09-24-2004 01:33 PM

If hda1 is system it is likely mounted on /
Was hda3 on a mount like /storage?

Unless hda3 contained something important like /usr or /var I don't see why your system has difficulty booting. When you are at the machine post the output of df -k and post contents of /etc/fstab.

How are your backups?

I've never run pvcreate on a live filesystem or even a partition or disk that I cared out the data on. It's likely that your data is gone or not easily retreived. If you have good backups, great, setup the LVM as you want and restore the data. If not, well... There is always the lvm resource page and mailling list:

http://sources.redhat.com/lvm2/

APRESTOUS 09-24-2004 02:08 PM

df -k output:

/dev/hda3 ....

etc/fstab something like that ( have to type ):
Label=/ / ext3 defaults 11
none /dev/pts devpts gid=5,mode=620 00
none /dev/shm tmfs defaults 00
Label=/home/second /home/product 2 0
none /proc proc ext3 defaults 00
none /sys sysfs defaults 00
/dev/hda2 swap default 00
/dev/cdrom /mnt/cdrom/ ....


Of course no backup, otherwise I wouldn't worry.


All times are GMT -5. The time now is 05:43 AM.