Koozali.org: home of the SME Server

USB Disk

Offline Markt606

  • *
  • 15
  • +0/-0
USB Disk
« on: May 10, 2017, 11:44:02 PM »
I am currently backing up files from workstations to a ibay on a 9.0 server. The files are now getting too large and the server is running out of space. My plan is to add a USB drive and have the files backup to it freeing up server space.

Is that sensible or even possible?

I can get the USB drive mounted but I don't know what I should see or do from that point! I can't see it listed with the other ibay's and can't see how I could link a new ibay to that drive. What should I be able to do?

Thanks in advance for any help and advice.


Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: USB Disk
« Reply #1 on: May 10, 2017, 11:52:41 PM »
one solution could be :

https://wiki.contribs.org/Disk_Manager


then create an ibay or add a folder in the ibay you want to backup, use the contrib to mount your disk here, et voila.
Just need to move the file there


usb2 might be a little slowish to access the file by the way. Not sure if usb3 is available on SME9, what I tend to do myself is the same but with eSATA drive and a PCI card to get the eSATA ports.


Also just adding a drive internally, and make all the ibays and user be on this drive, you have some how to on the wiki to get /home/e-smith/files on a separate drive. I will not recommend on usb ...
« Last Edit: May 10, 2017, 11:54:16 PM by Jean-Philippe Pialasse »

Offline Markt606

  • *
  • 15
  • +0/-0
Re: USB Disk
« Reply #2 on: May 11, 2017, 12:12:16 AM »
Thanks for replying so quickly.

I did install disk manager and I added the new drive but I couldn't see anything in the ibay to select it. I will have a read through that link you sent to see if I can see where I'm going wrong. I was doing it all on the interface not console.

What should go in the "mount to" field when I add it?

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: USB Disk
« Reply #3 on: May 11, 2017, 04:48:55 AM »
What should go in the "mount to" field when I add it?
the absolute path where you want to mount it ( I guess in your ibay)

that could be
Code: [Select]
/home/e-smith/files/ibays/MYIBAY/files/MYFOLDERYou must first create the folder MYFOLDER in your ibay.

It could be also directly the files folder of your ibay ( which is directly presented to you by samba if you disabled internet access to the ibay), but it will hide the original content of your file folder when you will mount the drive.

Offline Markt606

  • *
  • 15
  • +0/-0
Re: USB Disk
« Reply #4 on: May 11, 2017, 02:16:24 PM »
Thanks. I think Im getting closer  :-)

I have attached some screenshots.
- created an ibay called MYIBAY and a folder withing called MYFOLDER   ( just to keep things simple with your instructions! )
- I then used disk Manager to Add the USB disk, however, Mounted_To says "No" and Mountedto is blank.

When I remove the USB disk the files are still on the server so it hasnt mapped properly.

Am I missing a step? Is here a command I can use to look at the contents of the USB from the console?

Mark

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: USB Disk
« Reply #5 on: May 11, 2017, 08:26:36 PM »
I see 3 issues:
1- Interface shows none on the Mount points knowns, this is not normal as it shows USB on the Online drive table
2 -MountTo is empty in your known mount points , it should be filed with the full path to your
3- you should have a Modify action in the mount points known table before the remove, but this might be linked to the problem in 1.

hit the remove link

then redo the procedure:
1- hit add on the first table
2- fill the Mount To  filed with /home/e-smith/files/ibays/myibay/files/MYFOLDER
3- save

wait for drive to mount or hit mountto action to mount it

add some file

come back to manager, hit unmount
remove drive
check the content of your folder MYFOLDER that should be empty

if the issue persist  about the interface = none, you will need to fill a bug in bugs.contribs.org and provide more logs in order to investigate, sometime some usb drive are not beahing the way they are intended to. Some seagate are known to be bad  example.


Offline Markt606

  • *
  • 15
  • +0/-0
Re: USB Disk
« Reply #6 on: May 11, 2017, 08:40:42 PM »
Thanks that got a bit further, looks like the ibay in lowercase helped.

See the screenshot.

"wait for drive to mount or hit mountto action to mount it"    - I cant see where the option for "mountto" is! Is it in GUI or do you mean mount in the console?




Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: USB Disk
« Reply #7 on: May 11, 2017, 09:18:01 PM »
Thanks that got a bit further, looks like the ibay in lowercase helped.

See the screenshot.

"wait for drive to mount or hit mountto action to mount it"    - I cant see where the option for "mountto" is! Is it in GUI or do you mean mount in the console?
one more problem, you hit a 7 year old issue : you did not created a partition before formating your drive

your drive is known as /dev/sdb and its uniq partition formated as /dev/sdb, while it should have been formated as /dev/sdb1 : https://wiki.contribs.org/Disk_Manager#Your_drive_can.27t_be_mounted_thanks_to_usb_disk_manager

please refer to :

https://wiki.contribs.org/Disk_Manager#Format_your_drive



Offline Markt606

  • *
  • 15
  • +0/-0
Re: USB Disk
« Reply #8 on: May 12, 2017, 01:52:50 PM »
I have tried that and it is getting very close now. Just a couple of problems.

I cant seem to mount the drive through Disk Manager. If I try i get the error "wrong fs type" - see the screenshot attached. If I go to console and mount it using "mount /dev/sdb1 /media/usbdevice" it will mount. I can then go into Disk Manager and try the Mountto again which will then be successful.

The other problem is once mounted I cant write to the folder/USB drive. I get a message saying I dont have permission. Is there something I need to do to set the permissions? Th ibay has RW for everyone.

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: USB Disk
« Reply #9 on: May 13, 2017, 12:21:10 AM »
one solution could be to change the mount option and add :
Code: [Select]
uid=YOURUSER,gid=YOURGROUP
change YOURUSER and YOURGROUP to what username and groupname it should be for this ibay.

Offline Markt606

  • *
  • 15
  • +0/-0
Re: USB Disk
« Reply #10 on: May 13, 2017, 01:52:22 PM »
I added these in to the disk Manager mount options but it didnt make any difference. I hadnt actually created a group just set the ibay to give everyone write access.

I decided to start from 1st principles with a USB Memory stick I had ( 4Gb ). The disk I wantot use is a 1TB Toshiba external disk.

When I mounted the USB Flash drive it worked perfectly! I still had to manually mount from the console but I could then browse to the Outlook ibay and add files. When I go to MYiBay on the Toshiba drive I still you the message I dont have permission to write to it.

I have attached screenshots and the only difference I can see on the console screenshot is that it says rw, default for the flash drive but not on the Toshiba.

Is there anything different I need to do for a larger disk?

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: USB Disk
« Reply #11 on: May 13, 2017, 06:00:09 PM »
Do not mount two drive on the same folder, you will never know on which your are, depending on which on ewas the last mounted


The group for acces to everyone is :shared

Code: [Select]
uid=shared,gid=shared
Some reading for the options: https://linux.die.net/man/8/mount

defaults
Use default options: rw, suid, dev, exec, auto, nouser, async, and relatime.

So adding rw aside to default is useless. However adding let's say "users" will override the nouser

Offline Markt606

  • *
  • 15
  • +0/-0
Re: USB Disk
« Reply #12 on: May 14, 2017, 01:53:09 PM »
Hi

The two drives were mounted to 2 separate ibay's - one was on Myibay and the other on Outlook. I was only really doing it that way to show the flash drive worked and the disk didn't. I did exactly the same mount command with both ( apart from the folder path ) with no extra options.

If I try to add the gid/uid option I get an error message ( see screenshot ).

This is the command I am using ( is that correct syntax? ):

   mount /dev/sdb1 /home/e-smith/files/ibays/outlook/files/MYFOLDER -o uid=shared,gid=shared

If I remove the option at the end and just do the following it mounts as normal:
   
   mount /dev/sdb1 /home/e-smith/files/ibays/outlook/files/MYFOLDER

The error message is very similar to the one I get if I try to use Disk Manager through server-manager.



Offline Markt606

  • *
  • 15
  • +0/-0
Re: USB Disk
« Reply #13 on: May 14, 2017, 03:14:13 PM »
I have tried deleting everything and starting again!

I also formatted the USB flash drive as FAT32 as it would be useful to read it on Windows if needed. I have created a new ibay OBACKUP and created a folder under it called MYFOLDER

When I try to mount the USB drive using this command:

    mount /dev/sdb1 /home/e-smith/files/ibays/obackup/files/MYFOLDER -o uid=shared,gid=shared,iocharset=iso8859-1

I then get the same old message:

    mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
               missing codepage or helper program, or other error

If I do dmsg | tail I see this message:

    FAT: Unrecognized mount option "uid=shared" or missing value


Have I got the wrong syntax for the uid? It seems right from the reading link you sent.

Offline Markt606

  • *
  • 15
  • +0/-0
Re: USB Disk
« Reply #14 on: May 14, 2017, 05:39:49 PM »
UPDATE

I have the flash drive working with now. I had to set uid=backup,gid=classone ( backup is a user and classone is the group I have assigned to the ibay ). It just wouldn't accept uid=shared,gid=shared.

Its really the large disk I need to work though. I dont think I can format as Fat32 on something that big so I have just followed instructions from the start on it.

When I try to mount it with the same settings as the flash drive:

     mount /dev/sdb1 /home/e-smith/files/ibays/obackup/files/MYFOLDER -o uid=backup,gid=classone

I get the following error:

    EXT3-fs (sdb1): error: unrecognized mount option "uid=5005" or missing value

If I remove "uid=backup,gid=classone" it will mount but I cant get access to the folder.

Any ideas what that error message means?