1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/home/virtfs eating up space - not using jailshell

Discussion in 'General Discussion' started by PWSowner, May 10, 2009.

  1. PWSowner

    PWSowner Active Member

    Joined:
    Nov 10, 2001
    Messages:
    2,991
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    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?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,288
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Houston, TX
  3. PWSowner

    PWSowner Active Member

    Joined:
    Nov 10, 2001
    Messages:
    2,991
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    That says
    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.
     
  4. erick_paper

    erick_paper Member

    Joined:
    Apr 19, 2005
    Messages:
    246
    Likes Received:
    0
    Trophy Points:
    16
    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. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,288
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Houston, TX
    For future reference, here's the documentation for disabling and removing virtfs properly:

    VirtFS < AllDocumentation/WHMDocs < TWiki
     
  6. david510

    david510 Member

    Joined:
    Aug 22, 2004
    Messages:
    472
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,318
    Likes Received:
    7
    Trophy Points:
    38
    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.
     
  8. WebGraf

    WebGraf New Member

    Joined:
    Feb 13, 2010
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    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. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    12,123
    Likes Received:
    33
    Trophy Points:
    48
    Location:
    Pennsylvania
    Please read the documentation a bit closer, you've got a typo in your command.
    VirtFS < AllDocumentation/WHMDocs < TWiki

     
  10. WebGraf

    WebGraf New Member

    Joined:
    Feb 13, 2010
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    -bash: unmount: command not found!
     
  11. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    12,123
    Likes Received:
    33
    Trophy Points:
    48
    Location:
    Pennsylvania
    umount

    umount

    umount

    There is no n...
     
  12. WebGraf

    WebGraf New Member

    Joined:
    Feb 13, 2010
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Sorry! )))
    Thanks
     
    #12 WebGraf, Feb 18, 2010
    Last edited: Feb 18, 2010
  13. dystopian

    dystopian New Member

    Joined:
    Mar 13, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Is there now a /script to remove virtfs for a particular user in whm 11.25?
     
  14. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,318
    Likes Received:
    7
    Trophy Points:
    38
    /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.
     
  15. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,288
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Houston, TX
  16. mike25

    mike25 New Member

    Joined:
    Aug 29, 2003
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Raleigh NC, USA
    After running the script, and seeing that virtfs is gone, the disk usage displayed via df is unchanged. Is a reboot required or is there a simpler method to free up the space ?
     
  17. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,558
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    You may trigger usage of disk quotas to be recalculated using the following command via root SSH access; however, as with any maintenance, I would only consider running this during off-peak hours while no other users are logged in via SSH or SFTP:
    Code:
    # /scripts/fixquotas
     
  18. mike25

    mike25 New Member

    Joined:
    Aug 29, 2003
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Raleigh NC, USA
    No luck with that. I have also tried restarting all the main services with no luck. I will reboot if need be, but I am always weary of rebooting a live server that has an unknown issue .. especially since I just messed with the mounts and such. I did this one the long way before reading the entire thread and seeing a script now existed to complete the task, but I did run the script on another server and have the same issue on it as well.
     
  19. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,558
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    Please submit a support request so that we may inspect the precise circumstances involved and assist with further, in-depth investigation. When available, please to let me know the ticket ID number of your new support request so that we may follow-up internally; you are welcome to send me a private message (PM) with the ticket ID number.
     
    #19 cPanelDon, Sep 15, 2010
    Last edited: Sep 15, 2010
  20. sirdopes

    sirdopes Member

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Unless I am mistaken, most of the files that you see in /home/virtfs are hardlinks to files somewhere else. You are not going to see a decrease in diskspace since the files already exist on the server in another location. When you umount virtfs, you are just removing a hardlink to the file. Please correct me if I am wrong.
     

Share This Page