LinuxQuestions.org
Visit Jeremy's Blog.
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-24-2004, 09:38 AM   #1
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Rep: Reputation: 0
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.

Last edited by APRESTOUS; 09-24-2004 at 09:42 AM.
 
Old 09-24-2004, 09:57 AM   #2
slano
Member
 
Registered: May 2003
Distribution: slack,gentoo
Posts: 57

Rep: Reputation: 16
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
 
Old 09-24-2004, 10:00 AM   #3
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
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.
 
Old 09-24-2004, 10:16 AM   #4
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
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?
 
Old 09-24-2004, 10:38 AM   #5
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
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.
 
Old 09-24-2004, 10:49 AM   #6
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
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?
 
Old 09-24-2004, 11:00 AM   #7
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
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'.
 
Old 09-24-2004, 11:04 AM   #8
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
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.
 
Old 09-24-2004, 11:06 AM   #9
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
Label the partitions as LVM in cfdisk and save the partition table. reboot.
 
Old 09-24-2004, 11:29 AM   #10
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
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?
 
Old 09-24-2004, 11:32 AM   #11
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
It is 112 Mb
 
Old 09-24-2004, 12:11 PM   #12
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
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?
 
Old 09-24-2004, 12:36 PM   #13
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
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#

Last edited by APRESTOUS; 09-24-2004 at 12:38 PM.
 
Old 09-24-2004, 01:33 PM   #14
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
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/
 
Old 09-24-2004, 02:08 PM   #15
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
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.
 
  


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
changing hard disks aRm1983 Linux - Newbie 4 07-18-2005 01:11 PM
How many Hard disks ? BizHat.com Linux - Software 5 01-18-2005 07:38 PM
2 Hard Disks and 2 OS? How to? nbn792 Linux - General 5 12-26-2003 07:20 PM
2 Hard disks hadi Linux - Newbie 4 10-29-2003 02:34 PM
Bowsing Hard Disks halobungie Linux - Newbie 1 08-12-2003 08:40 PM


All times are GMT -5. The time now is 10:37 AM.

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