Mis-reported free space on USB drive

Chris Walker

New Member
Hello,

I have the Custom Firmware 3.03 installed on an HDR Fox T2 and have attached a 1TB USB 3 drive to it. I have then mounted the Humax remotely on my linux PC via CIFS.

When the Humax machine is mounted, the filer is indicating 61MB free and won't allow me to write to the USB drive whereas if I disconnect the USB drive and attach it directly to my linux PC, it shows over 200GB free.

Is this to be expected? I should perhaps add that the USB disc is NTFS formatted and I have installed ntfs-3g on the Hummy.

I haven't tried to FTP files to the USB drive to see if that fixes the problem as I prefer to have the Hummy shown as a mounted device but if it's worthwhile giving that a go, perhaps somebody could say so.
 
You can't mount a machine. You mount a share... and the share you have mounted is undoubtedly /media (although you have helpfully filtered that detail out).
/media is on a tmpfs filesystem which has 61MB free (and just contains symlinks to other storage).
So either share your USB drive directly, when the free space will be correct, or ignore it.
 
You can't mount a machine. You mount a share... and the share you have mounted is undoubtedly /media (although you have helpfully filtered that detail out).
/media is on a tmpfs filesystem which has 61MB free (and just contains symlinks to other storage).
So either share your USB drive directly, when the free space will be correct, or ignore it.

When you said '...you have helpfully filtered that...' I was simply saving myself some typing ;-)

I was indeed mounting the share as /media. I'll give it a try mounting the usb drive directly.

Thanks for your help.
 
Let me attend to a typo in my previous reply. I was mounting the share as /Media, not /media.

You suggested mounting the drive directly. I took that to mean //<IP addr>/dev/sda1 but that comes up with a cifs error so what did I misunderstand and what should I have written?
 
/media/drive1 is usually the USB drive and it's usually automatically shared as "drive1" so just use //<IP addr>/drive1 instead of //<IP addr>/media
Check /mod/etc/smb-hotplug.conf and the bottom of /mod/etc/smb.conf for a definitive answer.
The "media" share is just a hangover from the old days and it was changed because it caused exactly this confusion.
 
With the ntfs-3g package installed, an NTFS drive will be mounted as 'usb-drive1' if no other USB device is connected.
 
/media/drive1 is usually the USB drive and it's usually automatically shared as "drive1" so just use //<IP addr>/drive1 instead of //<IP addr>/media
Check /mod/etc/smb-hotplug.conf and the bottom of /mod/etc/smb.conf for a definitive answer.
The "media" share is just a hangover from the old days and it was changed because it caused exactly this confusion.

The bottom of the smb.conf looks like this :-
=================
include = /mod/etc/smb-hotplug.conf

# Retained for compatibility - this may appear as a small disk on the client
[Media]
comment = Media
path = /media
public = yes
writable = yes
browsable = yes
create mask = 0644
directory mask = 0755
hide dot files = no
=================
That suggests to me that I will always have this problem as the USB drive is being mounted automatically under /media so should I remove that section from the smb.conf?

Using the code above - //<IP addr>/drive1 - that fails with a cifs error of 'mount error(6): No such device or address'.

I then tried adding a section for Root like this (suggested in another thread) :-

[Root]
comment = Root
path = /
public = yes

But that didn't solve the problem either as I now got 0B free! So should I make some more amendments to the smb.conf (I have not modified the /mod/etc/smb-hotplug.conf filke at all yet) to make this work?
 
USB drives are supposed to be automatically detected and added to the .conf as mount points - but I'm not sure what process does that. Take a look at the "include" file.
 
USB drives are supposed to be automatically detected and added to the .conf as mount points - but I'm not sure what process does that.
Roughly, the kernel hotplug support kicks off "/sbin/mdev" which kicks off "/etc/mdev/run-and-gun" which kicks off "/mod/etc/mdev/z9samba" which modifies the "/mod/etc/smb-hotplug.conf" file, which causes an Inotify event to the Samba server to re-read its config. files to add/remove the share.
Kernel hotplug support is setup by "/etc/init.d/S60mdev" which is one of the things run by "/etc/init.d/rcS" which is run by "/sbin/init" (PID 1) during system startup.
Phew!
 
Chris Walker - USB drives are mounted automatically: take a look in smb-hotplug.conf. You can't edit this file (you can but your changes will be overwritten). In post #1 you mentioned that you have the ntfs-3g package installed; in post #6, I said that with this package installed the drive will be mounted as 'usb-drive1'. If you try and mount 'drive1' it will fail: mounting 'usb-drive1' should work. If you want to mount a subfolder within the USB drive, rather than the root of the USB drive you can do this by adding a section like the one below to the end of the smb.conf file (in this example the subfolder is called 'Recordings'):
Code:
[Recordings]
comment = Recordings
path = /media/usb-drive1/Recordings
public = yes
writable = yes
browsable = yes
create mask = 0644
directory mask = 0755
hide dot files = no
With the above section added to smb.conf, the folder 'Recordings' will be available as an smb
mount point, assuming there is a folder called 'Recordings' at the root of the USB drive, of course.
Edit: to correct error in path.
 
Last edited:
You did, and the solution is in there.
Corrected now.

I have a folder on the root of the USB drive called iPlayer_Downloads and that's what's I'm *mostly* writing to so I can certainly add that but I occasionally need access to another folder on the same level but I guess I could have another mount point for that.

Is another solution for me to edit the fstab file on the Fax HDR machine to include a specified mount point (I've noted what was said in point 10 so I'm assuming I could use the UUID of the drive) for the USB drive which skirts round the /media mount point (/usb_devices perhaps) and then add that to the smb.conf file so that I mount the root of the USB drive explicitly?
 
I don't understand why you can't just mount the point that smb-hotplug.conf provides.
Isn't that where we came in? I want the free space to be accurately displayed and the standard setup didn't do that.

I have now added an iPlayer_downloads section to the smb.conf file and issued a sudo mount -a command on my machine having modified the fstab file here. The filer now displays 204GB free for the mount. I also added another section to the smb.conf file and while it didn't display any errors on the mount command, it also doesn't show up in the file explorer here. But no matter, that can wait. I'm happy to leave it there as I now know the free space on the usb drive on the Fox machine.

Many thanks for everybody's help and ideas.
 
Obviously a bit dim and determined to do his own thing. Won't bother next time.
Thank you for deciding my intelligence level based on nothing. I appreciate that. With an IQ of over 150, *I* don't think I'm dim but who am I to suggest otherwise?

If both of you would like to look again at #7, you will see the response.

For what's worth, I have now a system that works to my satisfaction. If you also take a look at #15 you will see that I followed the advice of MontysEvilTwin and added two sections to the smb.conf file and on this machine I can see both of those mounts. So this bear of little brain appears to have made it work with advice from one of the members.
 
Disregarding prpr's dismissive comment (no doubt the result of frustration), what we don't understand (and what you have not stated) is why you didn't just use the "usb-drive1" mount that smb-hotplug.conf exposes, instead of going to all the trouble of adding your own 'special' to smb.conf. What was the problem with it? Are you saying that it still showed the wrong free space, despite not going via media?
 
Disregarding prpr's dismissive comment (no doubt the result of frustration), what we don't understand (and what you have not stated) is why you didn't just use the "usb-drive1" mount that smb-hotplug.conf exposes, instead of going to all the trouble of adding your own 'special' to smb.conf. What was the problem with it? Are you saying that it still showed the wrong free space, despite not going via media?

The problem that I wanted to solve was the free space not being declared to my satisfaction. In #2, prpr suggested the problem will always be present when using a mount /media so I took another route which I've described above. But .... I now realise that the solution was hidden in the chatter but which you've pointed out, namely that I tried to mount a share drive1 (post #5) but I helpfully skipped over the solution - post #6!

So despite my protestations that I'm not dim, it seems I am after all! Or suffering from word blindness.

For future reference, in case somebody searches the forum and comes across this discussion, the solution is in post #6, namely to share the drive as usb-drive1. In addition to the 2 mounts I have here, one for iplayer files and another for old Humax files (taken from a 9200), I now have a mount for the root of the USB drive. I probably won't keep that as I like access to the 2 specific folders but who knows!

Yes I could and should have looked more closely at what was being written rather than reading what I wanted to see. So apologies to everybody for tolerating me, or even being slightly less tolerant but I'll let you off, providing you do the same for me :)
 
Back
Top