Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: /home/virtfs eating up space - not using jailshell

  1. #1
    Registered Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,991

    Default /home/virtfs eating up space - not using jailshell

    The use jailshell on new account creation is not ticked.

    The manage shells shows nobody with jailshell, but some of my own accounts have normal shell.

    Those first 2 statements don't even matter though, as you'll see below. I only included them because searching for this issue has brought that up frequently.


    I use sftp to ftp to my accounts, and every one that I have sftp'd to now has /home/virtfs/username dir using 4GB each. Many threads and sources elsewhere say /home/virtfs doesn't actually use space, but on my server it either is using space, or my server thinks it is.

    According to "du -h --max-depth=1 /" and "du -h --max-depth=1 /home" for more detail, the virtfs subdirectory is using up 45GB of space.

    Using "df -h" verifies it is using actual space.

    Code:
    root@server [/]# du -h --max-depth=1 /home
    321M    home/oneuser
    444K    home/anotheruser
    ...
    45G     home/virtfs
    18M    home/moreusers
    ...
    144G    home/
    All /home/users totaled 98GB so du says virtfs is using space.

    I got a warning email this morning that / was running out of space.

    Code:
    root@server [/]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                          287G  196G   27G  91% /
    /dev/sda1              99M   19M   76M  20% /boot
    tmpfs                1001M     0 1001M   0% /dev/shm
    /usr/tmpDSK           485M   11M  449M   3% /tmp
    So I deleted some huge files (50GB worth) that I didn't need but wanted, and can get again later, so now I have 77GB free.


    Is virtfs supposed to use up actual space? If not, why is it?
    Is sftp'ing supposed to create the virtfs dir even though jailshell is off?
    How can I stop those virtfs dirs from being created?
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,289
    cPanel Access Level

    Root Administrator

    Default

    Many of your questions about VirtFS can be answered by reading:

    http://docs.cpanel.net/twiki/bin/vie...WHMDocs/VirtFS

    If you have any remaining questions after reading the documentation, let me know.

  3. #3
    Registered Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,991

    Default

    That says
    The /home/virtfs directory will be created on a user's first jailed shell login. This login can occur via SSH or through SFTP.
    I don't have any users set to use jailed shell, but as I said, if I use sftp for some of my accounts, it creates the virtfs. I did notice though that some of my accounts that I use sftp for don't have a virtfs folder, so I looked into that and found that on accounts I have set to use normal shell, that's not created. The ones that do create that, are not set to use normal or jailed shell, so it appears if neither is set, sftp automatically acts as if jailed shell was set.

    So, now I know that I just have to enable normal shell on any accounts I want to sftp to and those folders won't be created.

    I'll just enable normal shell for all my own sites and customer sites that I do the design for. Using sftp isn't an issue for clients who do their own design because I have it set to a different port, so anyone wishing to use sftp has to contact me first.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  4. #4
    Registered Member
    Join Date
    Apr 2005
    Posts
    246

    Default

    I'm trying to do the same. I want to clear /virtfs/ folder for most of my accounts. Eating up needless space. (Didn't know jailshell required so much space to enable!)

    I read this:
    VirtFS < AllDocumentation/WHMDocs < TWiki

    But "umount /...usr/bin" does nothing.

    When I try to remove the virtfs folder after setting the user to normal shell, it tells me a whole lot of processes that are going on, and doesn't delete the virtfs folder.

    What's up? How to get rid of this stupid folder and recover GBs of hard disk space?

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,289
    cPanel Access Level

    Root Administrator

    Default

    Quote Originally Posted by erick_paper View Post
    I'm trying to do the same. I want to clear /virtfs/ folder for most of my accounts. Eating up needless space. (Didn't know jailshell required so much space to enable!)

    I read this:
    VirtFS < AllDocumentation/WHMDocs < TWiki

    But "umount /...usr/bin" does nothing.

    When I try to remove the virtfs folder after setting the user to normal shell, it tells me a whole lot of processes that are going on, and doesn't delete the virtfs folder.

    What's up? How to get rid of this stupid folder and recover GBs of hard disk space?
    For future reference, here's the documentation for disabling and removing virtfs properly:

    VirtFS < AllDocumentation/WHMDocs < TWiki

  6. #6
    Registered Member
    Join Date
    Aug 2004
    Posts
    472

    Default

    To see if any user has virtfs mounted, use the following command.

    Code:
     cat /proc/mounts | grep virtfs
    If you see any you can umount them. That will solve the issue.
    Cliffsupport.com
    iWebManager | Access WHM from your iPhone & Android

  7. #7
    cPanel Development cPanelKenneth's Avatar
    Join Date
    Apr 2006
    Posts
    4,284
    cPanel Access Level

    Root Administrator

    Default

    There are some improvements coming in cPanel 11.25 that will address this. For example account termination will remove the virtfs entry for the account ( if one existed ). Also a /scripts utility will allow you to remove virtfs entries in a safe manner.
    Kenneth
    Development
    cPanel, Inc.

  8. #8
    Registered Member
    Join Date
    Feb 2010
    Posts
    18

    Default

    users do not have Jailshell
    but virtfs is not deleted

    unmount /home/virts/username/usr/bin
    -bash: unmount: command not found

    How to delete virtfs?

  9. #9
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    11,449
    cPanel Access Level

    Root Administrator

    Wink

    Quote Originally Posted by WebGraf View Post
    users do not have Jailshell
    but virtfs is not deleted

    unmount /home/virts/username/usr/bin
    -bash: unmount: command not found

    How to delete virtfs?
    Please read the documentation a bit closer, you've got a typo in your command.
    VirtFS < AllDocumentation/WHMDocs < TWiki

    You can safely remove VirtFS directories after unmounting them. To unmount a bind mounted directory, you can use the umount command. For example, if you wanted to unmount /home/virtfs/user/usr/bin, simply run the following command:
    •umount /home/virtfs/user/usr/bin

    To completely remove the jailed shell environment, all bind mounts under /home/virtfs/user/ must be unmounted. Once all bind mounts are unmounted for a user, the user directory under /home/virtfs for that user can be removed. To see if a directory is still bind mounted, search for the username in the contents of /proc/mounts.

  10. #10
    Registered Member
    Join Date
    Feb 2010
    Posts
    18

    Default

    -bash: unmount: command not found!

  11. #11
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    11,449
    cPanel Access Level

    Root Administrator

    Wink

    umount

    umount

    umount

    There is no n...

  12. #12
    Registered Member
    Join Date
    Feb 2010
    Posts
    18

    Default

    Quote Originally Posted by Infopro View Post
    umount

    umount

    umount

    There is no n...
    Sorry! )))
    Thanks
    Last edited by WebGraf; 02-18-2010 at 09:45 AM.

  13. #13
    Registered Member
    Join Date
    Mar 2009
    Posts
    6

    Default

    Is there now a /script to remove virtfs for a particular user in whm 11.25?

  14. #14
    cPanel Development cPanelKenneth's Avatar
    Join Date
    Apr 2006
    Posts
    4,284
    cPanel Access Level

    Root Administrator

    Default

    /scripts/clear_orphaned_virtfs_mounts will remove the virtfs directories for:

    1. users that no longer exist
    2. users that no longer use jailshell

    This script also takes a --clearall parameter which will remove all virtfs mounts regardless of the prior two conditions. Please exercise care when using this parameter.
    Kenneth
    Development
    cPanel, Inc.

  15. #15
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,289
    cPanel Access Level

    Root Administrator

    Default

    Quote Originally Posted by dystopian View Post
    Is there now a /script to remove virtfs for a particular user in whm 11.25?
    This is handled automatically when you change the shell associated with an account via WHM.

    Details about this are available on Page 15 (Section 1.22) of the 11.25 Release Notes:

    http://docs.cpanel.net/twiki/pub/All...leasenotes.pdf (PDF).

Page 1 of 2 12 LastLast

Similar Threads

  1. VirtFS - Jailshell - Trying to understand
    By fcbinfo in forum General Discussion
    Replies: 5
    Last Post: 11-20-2013, 02:36 PM
  2. /home/virtfs eating up space rapidly
    By vpsstore in forum General Discussion
    Replies: 4
    Last Post: 01-15-2011, 01:28 PM
  3. Replies: 4
    Last Post: 07-14-2009, 11:31 AM
  4. JailShell and VirtFS
    By emarton in forum General Discussion
    Replies: 1
    Last Post: 06-16-2009, 01:58 PM
  5. what is virtfs directory in /home/virtfs ??
    By SACHIN in forum General Discussion
    Replies: 9
    Last Post: 04-01-2007, 09:49 PM
bargain