Page 1 of 1

Mount linux partitions

PostPosted: Fri Mar 02, 2012 11:01 am
by guynux
As a linux user, I would like to mount on my PC filesystem the media linux partition from the LNS2 (not the FAT one) thru the back usb connexion as I do with my usb external disks formatted in ext3/4.
Thanks for this very good job

Re: Mount linux partitions

PostPosted: Fri Mar 02, 2012 7:53 pm
by fvdw
what do you mean with the "media linux partition" :scratch

You can already see all share via samba, FTP, NFS...when you have a Linux PC connected to the LAN

Re: Mount linux partitions

PostPosted: Mon Mar 05, 2012 9:16 am
by guynux
fvdw wrote:what do you mean with the "media linux partition"

Apologise,I mean the linux partition who contains the "public" directory
fvdw wrote:You can already see all share via samba, FTP, NFS...when you have a Linux PC connected to the LAN

Yes, it's what I use now ; but with the USB port you do'nt need any LAN and the copies can be faster.
You could even boot any PC with a live USB/CD ubuntu and directly make such copies.
I hope it is understandable with my poor english ;-)

Re: Mount linux partitions

PostPosted: Mon Mar 05, 2012 7:20 pm
by fvdw
Well in principle I think it is is possible but why did you buy then a NAS ? you could better have bought an external USB disk :whistle
I will put it on my to do list as a trial, but it has low priority

Re: Mount linux partitions

PostPosted: Tue Mar 06, 2012 6:34 am
by guynux
fvdw wrote:Well in principle I think it is is possible but why did you buy then a NAS ? you could better have bought an external USB disk :whistle

No, I use it always as a NAS for watching videos, but the back USB port would be very usefull to copy some files when you don't have any access to a ethernet port, even more if the media directory would be directly mounted on a linux box (or on any PC with a live ubuntu USB booting key/CD)
I will put it on my to do list as a trial, but it has low priority

It should be surely easy to you : any option in the etc/fstab ?
Thanks

Re: Mount linux partitions

PostPosted: Tue Mar 06, 2012 7:50 am
by fvdw
guynux wrote:It should be surely easy to you : any option in the etc/fstab ?
Thanks


its not that easy. The connection made via back port usb uses a special drivers and does not mount the partition in the usual way. In any case if the shared folders partition is connected via back port usb (assuming this is possible) then it will not be available via LAN. This because the way it works is that the driver from the back port usb assumes nobody else is doing any reading or writing to the partition. If some other program write to it the data might become corrupt as soon as you read/write to it via back port usb, meaning you would loose all data on it. Its a big risk therefor the method is implemented to use a disk image. You can copy data from this disk image when the back port usb is not in use to another shared folder.

Re: Mount linux partitions

PostPosted: Wed Mar 07, 2012 9:11 am
by guynux
fvdw wrote:its not that easy. The connection made via back port usb uses a special drivers and does not mount the partition in the usual way. In any case if the shared folders partition is connected via back port usb (assuming this is possible) then it will not be available via LAN...

Yes, it's a very sophisticated and secured way to use the USB port ; but, outside particular cases, you only use the USB when you don't have any LAN.
For me, considering the risk/benefice ratio, I think this process is in excess as far as I know the risk. Could it be an option in the interface for those informed people who want so ?
Always in admiration for your work !

Re: Mount linux partitions

PostPosted: Wed Mar 07, 2012 10:35 am
by Jocko
guynux wrote:Yes, it's a very sophisticated and secured way to use the USB port !

:shocked
No, it's the normal behavior of all files system !

Re: Mount linux partitions

PostPosted: Thu Mar 08, 2012 8:09 am
by guynux
Sorry, but I don't understand which is the right sentence :
this one assuming that there is a special process with a "special driver"
fvdw wrote:The connection made via back port usb uses a special drivers and does not mount the partition in the usual way. In any case if the shared folders partition is connected via back port usb (assuming this is possible) then it will not be available via LAN...

or this one :
Jocko wrote:No, it's the normal behavior of all files system !

As I understand, when you connect the USB port, the LNS2 is recognised as a USB storage and the filesystem (actually FAT only) is normally mounted on your host PC(any). Before that, you have to create this FAT partition (which lowers the disk space) on the LNS2; then to have to copy the content from the FAT to the ext3 "public" partition. As you know, such ext3 partition (and FAT also) could be directly and easy mounted on any linux host (or any PC using a linux live CD) via the USB port. So for a linux user, the process could be far shorter and space saving. Surely for security, better to disconnect the LAN. Why not ?
Am I wrong somewhere ? Thanks

Re: Mount linux partitions

PostPosted: Thu Mar 08, 2012 8:54 am
by fvdw
as said the back port uses a special driver (USB file gadget) it uses a disk image file as input, thats something different then a real disk partition. It is a big file on the ext3 partition were all shares are and it contains a file system. With the loop device this image is mounted and made visible as share when the back port usb is not in use. In principle this disk iamgecan contain any type of file system, we choose FAT32 because it is r/w in as well Linux as Windows.
Wheter or not the USB file gadget driver accept block device like /dev/sda8 (the one you are refering to) I need to check. But as said to make that partition available via back port USB then it must be unmounted from the NAS system, meaning almost all services running need to be stopped (and later restarted again when the partition is available again). If you do not unmount it the data on it will get corrupt when one of the NAS services is writing to or reading from it while connected to the back port USB and also data is read/wrtten via that port. This makes this complicated and risky