roxor's picture

Hello,i am using: Lighttpd PHP FastCGI on a home pc.

I want to add more space to ftp (add usb HDD)

How can i do this?

I insert the HDD on usb port, then?

How can i activate that hdd,i need to edit some option or?

Thank you.

Forum: 
Tags: 
Jeremy Davis's picture

So you'll need to find out what the device is. The easiest way to do that is to run

fdisk -l

with the device unplugged, then plug it in and run 'fdisk -l' again. Obviously the new device will be the additional one listed the second time. Let's assume that it's '/dev/sdc1'. Then make a new directory and mount it. E.g.:

mkdir /media/usbhdd
mount /dev/sdc1 /media/usbhdd

Assuming that it's a FAT filesystem that should work... If it's an NTFS filesystem it is generally recommended that you not write to it in Linux (i.e. mount as read only). In practice it will work (if the NTFS drivers are installed - I forget if they are by default in TKL) but if you remove it without unmounting (umount /dev/sdc1) then weird stuff will happen (files will disappear etc). Generally these issues can be fixed with a chkdsk from Windows, but not always... If you have some large files (>4GB) on your HDD but also want to write to it in Linux, then my recommendation would be to have 2 partitions on the disk. One NTFS (for big files) and one FAT (for use in Linux & other OS). If you only plan on using this in Linux then ext4 is probably a better choice (than FAT).

If you want to make it auto mount at boot (i.e. you plan on keeping it mounted all the time) then you'll need to add an entry to fstab (/etc/fstab). If you want to make it auto mount when you plug it in (like happens on desktop OS) then you can make that work too, but you'll need to do some research and testing as I'm not 100% sure what packages need to be installed. And you'll still want to unmount it prior to removing it...

roxor's picture

it works,but how can i add more space to ftp (to an existing user)?

I can use that HDD  only to new users?

http://s4.postimg.org/s8rnyucxp/Untitled20141006225815.png

Jeremy Davis's picture

In the example I used /media/usbhdd but instead you could use a sub-directory of a user's home (if that's what you want). Another option is to leave it as is and use mount with the '--bind' switch to remount /media/usbhdd wherever you want.

You may need to fiddle with permissions (for mounting) to make it writeable by your users. The thing to keep in mind though, is that if you mount it to an existing directory then the contents of the existing directory will be hidden and you will only see the contents of your USB HDD. (As unplugging a HDD that is part of an LVM will not be good!)

If you want to make your root partition (i.e. '/' - like in your screenshot) bigger, then the best way to do that is to increase the LVM size - see this blog post (it's a little dated but still relevant). However if you want to go that route I would NOT recommend you do it with a USB HDD, I would suggest that you get an additional internal HDD.

Also FWIW a lot of what I have written about is probably possible from within Webmin (rather than the commandline) but I'm not very familiar with Webmin.

Also another hint: While this is TurnKey Linux; it is based on Debian so if you google for Debian related info you will often find plenty of answers. TurnKey v13.x is based on Debian Wheezy (aka 7.x)

Add new comment