LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   editing fstab, setting up a network share with multiple drives (https://www.linuxquestions.org/questions/linux-server-73/editing-fstab-setting-up-a-network-share-with-multiple-drives-747101/)

mattca 08-12-2009 04:02 PM

editing fstab, setting up a network share with multiple drives
 
I have what will soon become a file server here running Mandriva 2009.1 and I need to set it up for use.

There are 6 physical drives, sda-sdf. According to my fstab (pasted below), the OS is installed on sdb.. and for some reason I have a swap partition on sda and sdb. I had a horrible time getting a working installation, and that's probably leftover from a previous attempt.

Question 1: Can I simply edit my fstab to remove the swap on sda, effectively confining all system resources to sdb?

The end result I want is all storage space over all drives accessible from a single mount point which can be accessed over the network.

Question 2: Once I sort out the weird fstab, what's the best way to go about setting this up? I imagine I need to format & partition the other drives (all but sdb).. but as far as organizing the free space, what's the best way? Is it possible to have multiple physical drives accessible from a single mount point? Or will the users have to use each drive separately? I was thinking I could create a directory on sdb (in /home?) to use as a root for the network share, and then automount the other 5 physical drives there. Does that make sense?

Thanks for any advice.

Code:

/etc/fstab:

# Entry for /dev/sdb1 :
UUID=7461ae34-aaa1-443d-82e1-fc9000afcc42 / ext3 relatime 1 1
# Entry for /dev/sdb6 :
UUID=41535e04-0368-4682-ab9c-5f791bfea803 /home ext3 relatime 1 2
/dev/cdrom /media/cdrom auto umask=0,users,iocharset=utf8,noauto,ro,exec 0 0
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=9edbc49b-302c-43c8-8264-ed49a7f1fff2 swap swap defaults 0 0
# Entry for /dev/sdb5 :
UUID=b7039857-dfae-4a92-8ff4-9d1cdcf25351 swap swap defaults 0 0


acid_kewpie 08-12-2009 04:07 PM

1 - yes, delete the entries and then the partitions, there's really nothing that can go wrong, as long as you ensure the swap is definitely not in use when you nuke the partitions

2 - lvm. combine an arbitrary number of partitions across multiple devices into a single filesystem. You can have a degree of redundancy in place too using the --mirror option during lvcreate, without needing exact matching geometries and such like you would for a raid0 or raid5 implementation. Simple example here: http://linuxdevcenter.com/pub/a/linu...-with-lvm.html

mattca 08-12-2009 04:19 PM

Thanks for your quick reply.. and for the suggestion for lvm, I will check it out.

Quote:

delete the entries and then the partitions, there's really nothing that can go wrong, as long as you ensure the swap is definitely not in use when you nuke the partitions
Awesome.. how do I go about ensuring the swap partition in question is not in use? Will swapoff do the trick?

Thanks again.

acid_kewpie 08-13-2009 12:47 AM

it should be fine, but ideally no swap shoud be in use in the first place. I've had some systems crash doing a swapoff of a swap partition whne it was already being used. safest is certainly to delete the fstab entry and then reboot.

mattca 08-13-2009 10:05 AM

Thanks, got the fstab sorted out.

I realized I forgot to mention that this file server will only be accessed from Mac computers (via NFS). Is that possible with LVM? It seems easier to do what I suggested above - create a root directory for the share in one drive, then mount the other 5 there. But maybe LVM will be easier in the long run?

[ETA: After thinking about it, I imagine it depends on the file system used, and that the client won't know the share it's connecting to is managed by LVM. Would ext3 be the best choice?]

tredegar 08-13-2009 10:27 AM

Quote:

...Mac computers (via NFS). Is that possible with LVM?
So far as I know, there shouldn't be any problem (No Mac to play with though). The network doesn't care what filesystem the files are on.

It's a nice idea, but I'd be careful with LVM - if there is data corruption or a disk error, recovering your data can be very tedious and complicated. Maybe you'd like to do a search on LVM Data Recovery - there are some horror stories:
http://www.linuxquestions.org/questi...h-data-561164/
http://www.linuxjournal.com/article/8874
Etc.

Maybe you have a good backup strategy though.


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