Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
dude67

Advice needed on building network storage

Recommended Posts

Generally when you partition in openfiler you set up a volume group and then you create logical volumes for the data that you will use. This is irrespective of whether you have multiple disks or not. I had 1 x 100GB disk that I was using for my demo.

 

As you say, and know, LVM allows you to add another disk and expand the volume group and then extend your logical volumes accordingly. Much easier way of resizing partitions than having to move them all around when you want to make changes.

 

An LVM snapshot, takes a backup at that point in time of that particular logical volume, so that you can revert to it as and when you need to.

Share this post


Link to post
Share on other sites

I have it installed! :thumbs: I'm just trying to figure it out so wish me luck. (And, Ian, if you can, send me the article - I've sent you a private message).

Share this post


Link to post
Share on other sites

OK, I've got it installed and I have made several shares on it. :thumbs:

 

I would need to do a few things. I haven't been able to figure them out myself, so I turn to you again.

 

1) I would like to set credentials to allow access depending on the group. I have set a few groups (in addition to the username-groups dude67.dude67 etc.): family (all family members have access) and adults (me and my wife have access). I have added the same users and groups in Openfiler and Mandriva. But whenever I set the share access control mode to Controlled access and set the names' and groups' rights (as described above) I cannot mount the drives (shares) in Mandriva.

 

I have tried editing /etc/fstab and from sabma config in MCC, but I always get this:

$ sudo mount -v /home/levyasema/videot/dvd

mount.cifs kernel mount options: unc=//192.168.254.1\levyasema.videot.dvd,user=dude67,ver=1,rw,credentials=/etc/samba/auth.192.168.254.1.dude67,ip=192.168.254.1,pass=********
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

As you can see, I've set up samba password file, but I have also tried to add the credentials directly into /etc/fstab. However the results are the same

 

BTW do you know what the user and usergroup "96" is? When I have set share access control mode to public guest access, I see this user and usergroup listed in my mandriva box:

drwxrwsrwx+ 2 96	96	0 2009-10-28 17:06 dvd/

It must have something to do with the public guest access control mode, but I seem to have some problems renaming or creating files as myself. I need root user rights in order to create a new folder...

[dude67@localhost new]$ ls -la
total 0
drwxrwsr-x+ 2 96 96 0 2009-10-31 15:22 ./
drwxrwsrwx+ 3 96 96 0 2009-10-31 15:22 ../
[dude67@localhost new]$ mkdir second
mkdir: cannot create directory `second': Permission denied
[dude67@localhost new]$ sudo mkdir second
Password:
[dude67@localhost new]$ ls -la
total 0
drwxrwsr-x+ 3 96 96 0 2009-10-31 15:23 ./
drwxrwsrwx+ 3 96 96 0 2009-10-31 15:22 ../
drwxrwsr-x+ 2 96 96 0 2009-10-31 15:23 second/
[dude67@localhost uusi]$

 

2) I haven't figured out yet how to back up the whole contents of this system. Perhaps to an outside network storage (WD MyBook WE I) or to the second hard drive. I've currently added both drives into this LVM, but I can now easily drop it from this current volume. :D

 

3) Does anyone know if I can make the openfiler drives into media server PS3 would understand? If not, I should be able to install this in openfiler: http://code.google.c...ps3mediaserver/

Share this post


Link to post
Share on other sites

I can try help you with point 1 and LDAP, I'll need to get working on my install here :)

 

Point 2 I can probably help you with - but don't add extra disks to the existing volume group, else they will be a part of it and you won't have a backup. You'd need to make a second volume group for the additional disks, and I'm sure you can do lvm snapshots from the "usable" disk to the "backup" disk. Of course, if internal, means you're exposed in the event of a fire or your machine gets stolen. If attached via usb, then you'll have some sort of resilience since you could move it away to another building. It depends what you want to achieve :)

 

Point 3 I can't, I don't have a PS3, sorry :)

 

Give me a bit of time for points 1 and 2, maybe this week I can have something for you.

Share this post


Link to post
Share on other sites

Give me a bit of time for points 1 and 2, maybe this week I can have something for you.

That would be great! In the meanwhile, I will try to learn by doing and from their forum (which is not the busiest forums I've seen).

 

Point 3 I can't, I don't have a PS3, sorry :)

Man, you've got to get one! I don't know what I'd do without one. :lol2:

Share this post


Link to post
Share on other sites

Point 2 I can probably help you with - but don't add extra disks to the existing volume group, else they will be a part of it and you won't have a backup. You'd need to make a second volume group for the additional disks, and I'm sure you can do lvm snapshots from the "usable" disk to the "backup" disk. Of course, if internal, means you're exposed in the event of a fire or your machine gets stolen. If attached via usb, then you'll have some sort of resilience since you could move it away to another building. It depends what you want to achieve :)

Ok, I just realized when going through all the webinterface options that I cannot disengage the second harddrive (sdb1) once I've added it to a VG, can I? In addition to that I've already transferred a lot of stuff there and I would not like to do that again - if I have a choice. But can I change the size of the volume group and drop one hdd from it?

 

Is there anything I can do?

Share this post


Link to post
Share on other sites

Yes, you can add/drop drives from a volume group easily enough - I've done this from the command line, so I expect you can do it also on the openfiler machine too via SSH access to the openfiler machine. You can connect with the root user, as this is what I've done previously.

 

Check this article:

 

http://tldp.org/HOWTO/LVM-HOWTO/removeadisk.html

 

I've only actually added disks, but removing should be just as easy as mentioned in the article above. Just of course make sure you got a copy of that data "just in case".

Share this post


Link to post
Share on other sites

Thanks Ian, that is a very nice howto for LVM. And the removal of an old disk looks simple enough, so I'll try it tonight. I will not make a back up as I still have the data in the hdd I copied it from originally.

Share this post


Link to post
Share on other sites

OK, cool :thumbs:

 

Let us know how you get on. I'm surprised the gui doesn't let you do it, but then it might not be geared up for disk removal. The tools from the CLI should allow you to do it though, and those commands in that howto should move any data (extents) from that disk to the existing disks providing that there is space free. Then you can of course safely remove it. That's why I mentioned about the backup but of course you have the data anyway so no problems. If there were not enough extents available on the disks being left in the system, then you'd end up removing the disk and you'd be missing data.

 

Another way around that if none of the remaining disks have any space (extents) free, is for example if you want to remove a disk (because of bad blocks, etc), is add a new disk to the LVM at the same size or higher than the one being removed, then run the removal commands and it'll move the extents from the disk being removed to the new disk that was just added. Hope that makes sense :)

Share this post


Link to post
Share on other sites

OK, I started with the howto "removing an Old disk" but the first command got me... I got this

# pvmove /dev/sdb1
Required device-mapper target(s) not detected in your kernel

I didn't know what to do. I tried this:

# pvmove /dev/sdb1 /dev/sdc4
Required device-mapper target(s) not detected in your kernel

OK, no help.

 

Then I googled a bit and found this bit of advice from a debian-user site:

> # pvmove /dev/hda7 /dev/hda5

> mirror: Required device-mapper target(s) not detected in your kernel

please try:

modprobe dm-mirror

I did that and the magic worked! B)

 

# pvmove /dev/sdb1 /dev/sdc4
/dev/sdb1: Moved: 0.1%
/dev/sdb1: Moved: 0.2%
/dev/sdb1: Moved: 0.3%
...

Now it's moving the files, although a bit slow.

:thumbs:

Share this post


Link to post
Share on other sites

Yeah, pvmove is a bit slow. I was under the impression though that pvremove should have taken care of it for you though, although I'm not entirely sure as I've not read much about it or tried it yet. Will have to check and test it :)

 

EDIT:

 

pvremove will remove the disk but not move any data on it - or so it seems from what I read. So, the command would normally be vgreduce first, which should sort out the stuff, and then pvremove to remove it from the volume group.

Share this post


Link to post
Share on other sites

OK, it did more than I bargained for. I did first the pvmove and then when trying to remove the /dev/sdb1 I seem to have deleted everything from the volume group I had. I used this:

pvremove -vff /dev/sdb1

Now I cannot see the /dev/sdb1 anymore, but also /dev/sdc4 is empty!

pvdisplay /dev/sdb1
No physical volume label read from /dev/sdb1
Failed to read physical volume "/dev/sdb1"

And when I try to find the one the I should have with this:

# pvdisplay /dev/sdc4

I get a long list of Couldn't find device with uuid 'wt7... and finally at the end:

--- NEW Physical volume ---
PV Name /dev/sdc4
VG Name
PV Size 1.36 TB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
PV UUID FJ9GCo....

 

I went into the GUI and I cannot find any volume groups anymore.

 

When I look at the Block Devices, I can still see the partitions, but no Volume Group. I cannot add any VGs so I guess I need to start from the top. Or perhaps there's a table somewhere I could fix... But that's for tomorrow.

 

I'll do one reboot and call it a day.

Share this post


Link to post
Share on other sites

Wow, thanks. He's final solution is way out of my league though... :unsure:

 

But I can try some of the commands he tried along the way. I'll post back when I've had time to test it.

 

I'm not in risk of losing any data - I only need to move the data back to the new disks if I redo the LVM disks. But perhaps I can learn something about it, if I still try to fix it. Then again, I may want to just go and do it all again as I may want to do some changes to my shares anyway.

 

If I start from the top, my approch could be a bit different.

 

I have 2 similar 1.5 TB hdds. Maybe I should RAID1 them and do the backups (snapshots?) in my external nas (WD MyBook WE 1TB). As you pointed out, it may be best to have the backups in a totally (physically) different hw - something that can be carried out should something go wrong with the first hw set.

 

But if I have understood correctly, I can still set it up like that, if I manage to salvage this current setup. Is that not so?

 

If I want to do the shares again, I would need to start the setup from the top as I have some 100 GB worth of data already transferred to the disks' shares. I have set up several main shares and created folders underneath the shares. Basically this is OK, but it looks funny as the shares are (translations from Finnish names) named like this: networkstorage.images.photos | networkstorage.images.graphics | networkstorage.files.documents | networkstorage.files.sys-files etc. My idea was to have them under the storage like this:

- networkstorage
|- images
	|- photos
	|- graphics
|- files
	| -documents
	|- sys-files

 

But I still have to mount them separately (also in windows, I would need to map the network drives to the letters individually). So perhaps I should just create the first tier folders in my Openfiler LVM setup and do the rest from the local PCs in my LAN.

 

 

====

But this is starting to be more about building and fixing LVM than just building network storage. Perhaps you - as an admin - can cut this thread half-way through and move it into a new thred with a more suitable topic name (like Building an LVM network storage - or something along those lines).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×