William's picture

I am posting a new thread as I dont know that this would particularly fit under any 1 specific thread, and felt mentioning of both issues may help as it could point to a different issue that I have yet to think of so anyway here it goes:

 

problem 1

I have the torrent file server set up, I have 2 sata 1tb drives [ntfs] (connected via raid card, but just connected individually, no raid set up) mounted for storage only, have 1 80GB hdd [pata] for system files (torrent server appliance, packages etc...) I have both mounted to /srv/storage/hdd1 and hdd2 respectively. I can read write and execute files on one drive, but not the other. odd thing is if i unmount them both and remount switched, its the same physical drive that I can not write to.

 

problem 2

I am trying to set this up as a print server as well. I have CUPS installed, and have the drivers intalled for my printer. edited cupsd.conf to allow web access via port 631. I can log into the cups interface and print a test page (so this shows the printer is installed and connected to the server properly) Jeremy aka jedi master commented on a previous post I made regarding this issue and agreed with me it sounds like a permissions issue....my question is should I be looking at CUPS, and the cupsd.conf file, the web interface for cups, or should i be looking in the SAMBA section using webmin of turnkey linux????

 

I post and say that I think the problems could be related as they are both permission issues, and was thinking there could be an underlying cause to both of these issues that would fix both. idk,  I could be wrong (probably am) but just trying to make as informative of post as possible hoping that someone reading this will have a light bulb go off and will have an answer for me.

Forum: 
William's picture

Problem 2 above has been fixed. but still can not figure out problem 1. I re-installed my server, and got the printer going, but now can not write to either of my two drives

Jeremy Davis's picture

The first thing I'd do is to check that you can write to the drive from within Linux (ie work out if it is a Linux system issue or a Samba issue - or possibly both...).

An easy way to check that you can write is the 'touch command (it creates a blank file), so something like this:

touch /srv/storage/hdd1/test
touch 
/srv/storage/hdd2/test

If that works, then I reckon it must be a Samba (probably permissions) issue. If that doesn't work then I'm guessing that the hard drives are mounted read-only under Linux. The most common reason for that is file system errors. Assuming that they are formatted a native Linux FS (eg ext4, etc) then you can do that within Linux. First unmount them with 'umount'. You'll want to find out what the drive is called using 'fdisk -l'. Once you know what the drive is you can unmount it (eg umount /dev/sdb1 - where /dev/sdb1 is the name of the partition) and run a disk check on it ('fsck /dev/sdb1' - again where /dev/sdb1 is the name of the partition ).

William's picture

<off topic side note>

First want to say thanks for all the help Jeremy. it seems you put alot of effort into helping everyone on this board. I read one of your post where you said you used webmin initially but now do everything almost exclusively through CLI, I have to agree, CLI seems much better and I seem to get the results I want that way. also seen a conversation where you were talking about some of the downfalls of TKL, and I also think a centralized "wiki" of some sort would be very beneficial to TKL. or some better documentation, like a newbie user guide to using webmin.

</off topic side note>

anyway, I found that I can mount the drives using CLI and they work just fine, but my issue is, they are both 1TB drives, and they are only showing up as having like 60GB when connecting to them from my windows machine. I forget the command I ran, but in the CLI they show up having like 1000005 MB or something like that....so the space is there, but for some reason when I mount them, I do not have access to all available space. I have this formated as NTFS as they are being shared out for windows machines only and not being used with any other operating system.

 

I have looked around online and seen people having an issue where linux doesnt show the right size, but thats not the same issue im having, if im in CLI and I check the size its fine, when I mount the drive, and go to the shared drive remotely, im being told its 60 something GB in size...

Jeremy Davis's picture

NTFS may be your issue!?

But firstly thanks for your kudos. I do it for the love! :)

As for better documentation, yes it would be great. But personally I haven't got the time or the patience... On another thread Chris has offered to make some Video tutorials. If that is something you think would be useful (or you'd like to help him out with that) perhaps head over to his thread and post a request/suggestion. And if you'd like to contribute to documentation too then you're more than welcome. The TKL Docs are a community wiki and can be edited by anybody, so feel free to head over there and start writing...

Now back to the problem at hand. So is your Torrent Server appliance dual boot? Or is it TKL only? In other words, when you say you connect from your Windows machine is that via Samba (ie Windows File Sharing) or physically connect (ie with the hard drives physically connected to the hardware running Win?

The reason I ask, is because Windows won't care what the underlaying FS (filesystem) is if you are connecting via Samba (through TKL). And a non-native Linux FS won't support Linux file permissions (and I anticipate ongoing permission issues within Linux if you persist).

Also, although Linux NTFS support has come a long way, in my experience it is still a little flakey at times (eg power outage or improper shutdown will cause serious issues including data corruption or loss - issues that can not be resolved within Linux, only Windows...). If you are dual booting then IMO FAT is a much better option (although you still will still potentially have permissions issues; not to mention the other limitations of FAT such as max file size of 4GB). But unless you are planning to access the drives directly from Win (ie physically) then ext4 is my preference for FS.

As for your HDD size, I suspect that the command you used was 'fdisk -l'. That will show the total size of your HDD(s), whereas Windows is only showing the size of the share available. Besides, in my experience this is rarely correct anyway... I have a 2TB HDD connected to my Fileserver with 1.5TB data already on it and Win reports 2 of the shares on that drive as both having 1TB each free (how you could store 2TB data in 500MB of space is beyond me...)

So assuming that your TKL server is not dual boot and the only way you access the drives from Windows is via Samba, then reformat each drive as ext4 (fdisk is what I use) making the whole of each drive one big partition. Then edit /etc/fstab to include them (so they mount at boot).

As for your filesharing config, IIRC mounts inherit the permissions of where they're mounted (in which case you won't need to do anything if you have /srv shared the way you want it).

If you want to have multiple users with different read/write permissions then set up your users/groups (if you haven't already). Once that's done, the way I go is to use Linux file permissions to control writes (ie grant all users read permission to all resources and limit writes to certian groups/users) then use Samba to control read access (ie give users/groups access to certain shares and grant all users read/write permissions). I'm not sure whether that it is necessarily the best way to go, but it's what I do and has served me well for many years. As an aside; it's the same way I administer my Win shares on the network at work (between Win 2k3 Server and WinXP desktops) - use file permissions to control write access and share permissions to control reads.

William's picture

 

I dont feel I know enough about Linux to really be able to contribute, although if a way arises that I could, I might depending on what it is and how much free time I have

I feel TKL can be much better than what it already is though. but the support part is lacking, but then again it is free and its all from people voluntering their time and energy to support it, so I guess I can't really expect the same kind of support that you would get from other comercial programs and operating systems.

Now back to the problem at hand. So is your Torrent Server appliance dual boot? Or is it TKL only? In other words, when you say you connect from your Windows machine is that via Samba (ie Windows File Sharing) or physically connect (ie with the hard drives physically connected to the hardware running Win?

Server is an old desktop, with 1 pata hard drive for the TKL OS. not dual booting (god, the bugs in widnows, and the issues ive encountered here...that would be a nightmare for me i think) and yes I am connectinv via samba (I think) as in, I have the server set up drives shared out, and I use my laptop (win 7) and go to \\[internal ip of fileserver here]

The reason I sk, is because Windows won't care what the underlaying FS (filesystem) is if you are connecting via Samba (through TKL). And a non-native Linux FS won't support Linux file permissions (and I anticipate ongoing permission issues within Linux if you persist).

good to know information. only reason I kept them NTFS is I thought I had to keep them NTFS since they were being used for storage from windows machines

Also, although Linux NTFS support has come a long way, in my experience it is still a little flakey at times (eg power outage or improper shutdown will cause serious issues including data corruption or loss - issues that can not be resolved within Linux, only Windows...). If you are dual booting then IMO FAT is a much better option (although you still will still potentially have permissions issues; not to mention the other limitations of FAT such as max file size of 4GB). But unless you are planning to access the drives directly from Win (ie physically) then ext4 is my preference for FS.

Permissions are not an issue, since its only accessed by me, mainly being used for me to back up my stuff, and store other peoples files and what not if i have to format someone else's computer, thanks for the heads up about the NTFS stuff as thats what I done, I installed NTFS-3G I belive it was called, and FUSE to enable NTFS writing, but from your experince it sounds like this might be a bad idea.

As for your HDD size, I suspect that the command you used was 'fdisk -l'. That will show the total size of your HDD(s), whereas Windows is only showing the size of the share available. Besides, in my experience this is rarely correct anyway... I have a 2TB HDD connected to my Fileserver with 1.5TB data already on it and Win reports 2 of the shares on that drive as both having 1TB each free (how you could store 2TB data in 500MB of space is beyond me...)

Right, and this is the exact issue I was having. windows showing way less space available than what I actually had.

So assuming that your TKL server is not dual boot and the only way you access the drives from Windows is via Samba, then reformat each drive as ext4 (fdisk is what I use) making the whole of each drive one big partition. Then edit /etc/fstab to include them (so they mount at boot).

Think thats what I'm going to do, even though I have mounted my drives again and now can see the full size of them, I want to batten down the hatches and lock everything down so that I dont run into more problems

As for your filesharing config, IIRC mounts inherit the permissions of where they're mounted (in which case you won't need to do anything if you have /srv shared the way you want it).

If you want to have multiple users with different read/write permissions then set up your users/groups (if you haven't already). Once that's done, the way I go is to use Linux file permissions to control writes (ie grant all users read permission to all resources and limit writes to certian groups/users) then use Samba to control read access (ie give users/groups access to certain shares and grant all users read/write permissions). I'm not sure whether that it is necessarily the best way to go, but it's what I do and has served me well for many years. As an aside; it's the same way I administer my Win shares on the network at work (between Win 2k3 Server and WinXP desktops) - use file permissions to control write access and share permissions to control reads.

Jeremy Davis's picture

IMO that's mostly because they don't take anything for granted. After you've been using Linux for a few years it's easy to forget that some things aren't at all obvious unless you know... But no pressure, just if you have time and are keen. I often glance over the docs and tidy things up, so even if you aren't sure about something, do your best and myself or someone else will fix it up (if need be).

Don't get me wrong, NTFS is generally quite usable under Linux, but it is far from my preference and shouldn't be used unless you have to IMO - and never on a LInux only box.

And FYI Samba is the Linux (and Apple) program that provides CIFS/SMB (Common Internet File System/Server Message Block ie Windows file sharing). As the name suggests it provides a network FS that is readable by any OS that knows how (eg Win by default, Linux and OSX with Samba) so only the host system accesses the true underlaying FS.

Add new comment