Defragging SSD in VM

Discussion in 'Virtualization' started by HelpMe, Feb 29, 2016.

  1. HelpMe

    HelpMe MDL Junior Member

    Jul 30, 2009
    90
    7
    0
    Hi, i would like to know, is it safe to defrag or use the clean disk option on a ssd drive that is running in a VM.
     
  2. MrMagic

    MrMagic MDL Guru

    Feb 13, 2012
    5,725
    3,743
    180
    You don't defrag SSDs
     
  3. HelpMe

    HelpMe MDL Junior Member

    Jul 30, 2009
    90
    7
    0
    In my vm, i got a message saying my hd needed defragment, but i am running as ssd on my host, so i guess i should ignore that defrag message.
     
  4. bpwnes

    bpwnes MDL Member

    Aug 11, 2015
    151
    27
    10
    I would ignore the messages. I'm guessing the VM doesn't have host access to the drive to know it's an SSD, hence the messages.
     
  5. eliam

    eliam MDL Novice

    Oct 30, 2009
    16
    0
    0
    never defrag a SSD , or vm on ssd :)
     
  6. kaljukass

    kaljukass MDL Addicted

    Nov 26, 2012
    870
    295
    30
    Even if you really want, it is not possible.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. EFA11

    EFA11 Avatar Guru

    Oct 7, 2010
    8,730
    6,667
    270
    #8 EFA11, Sep 9, 2016
    Last edited: Sep 9, 2016
    you would be doing a defrag on a virtual container (large file) on your SSD, the SSD wouldn't get the defrag.

    The virtual container (VM sees it as an HDD), can and does get fragmented As Mr.Magic has shown, do the degrag on the VM's drive from within the workstation settings.

    -ed-
    unless of course you created the VM and told it to use a physical drive, then yeah do not defrag the thing already.
     
  8. Carlos Detweiller

    Carlos Detweiller MDL Spinning Tortoise

    Dec 21, 2012
    2,362
    1,957
    90
    If the Host drive is an SSD, you should declare the Guest being SSD, too. For example, Virtualbox has a checkmark in VM storage settings to switch the media type.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,988
    1,316
    120

    Clean disk is obviously safe, defrag is a different matter.

    Although is common to say never defrag an SSD, I'm not sure that the sentence should be taken to the letter. A fragmented FS is still fragmented on an SSD, the difference is that there isn't any mechanical inertia to fight so the performances wouldn't be affected that much.

    But a minimal overhead would be still present, and some additional in file writing could also affect some writing performances especially on older and less refined/smart flash controllers. But more than that a fragmented FS could impact negatively an eventual recovery process in case of messed FS/deleted files by mistake and so on.

    So my idea is that while the defrag should be avoided on weekly or monthly basis, like on platter HDDs, doing it once per year or so surely doesn't hurt, and may be also helpful.

    Also the average user is overconcerned about the SSD wearing. Personally I have yet to see a single broken or run out SSD and I was a very early adopter, for personal usage and ad upgrade on my client's PCs.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. WinFree

    WinFree MDL Member

    Aug 6, 2016
    154
    28
    10
    Thank you for this.