Thinking about putting an SSD in my Ubuntu box and have some ?'s

Discussion in 'Linux/BSD/Free Systems' started by Deadjasper, Apr 27, 2011.

  1. Deadjasper

    Deadjasper [H]ard|Gawd

    Messages:
    1,393
    Joined:
    Oct 28, 2001
    1. Does Ubuntu make proper use of SSD's?

    2. Is it possible to move my install from it's current regular HD to the SSD or would I be better off doing a fresh install?

    TIA
     
  2. deff

    deff 2[H]4U

    Messages:
    2,644
    Joined:
    Feb 20, 2008
    Sure does as long as your kernel is 2.6.32 or higher and your drive is formatted in Ext4 (I believe this is the only supported FS currently). Linux won't detect the SSD automatically, so you'll need to go into fstab and add "discard" to the options list for your SSD.

    Here's a good article to help you out.

    I would do a clean wipe, but I tend to go overboard with things. I feel doing a fresh install is the easiest way.
     
  3. Spare-Flair

    Spare-Flair [H]ardness Supreme

    Messages:
    7,482
    Joined:
    Apr 4, 2003
    I decided that since the SSD boots so damn fast that I would just run Ubuntu as a virtualization in VMware in Win7.
     
  4. Deadjasper

    Deadjasper [H]ard|Gawd

    Messages:
    1,393
    Joined:
    Oct 28, 2001
    Thank you, sir. This is most helpful. I assume from reading the link that I first install Ubuntu and then enable TRIMM, correct?

    I've decided to do a clean install, that everything starts out fresh.
     
  5. deff

    deff 2[H]4U

    Messages:
    2,644
    Joined:
    Feb 20, 2008
    This is correct. On a side note, if you're using a drive that has previously been used its a good idea to restore it to factory by issuing a secure wipe. From my understanding, merely formatting a SSD isn't enough to regain its out-of-the-box-new read/write performance.

    To do a secure wipe, you basically run the Ubuntu live CD, open a terminal and use HDPARM to issue the wipe command on the SSD.

    Here's another article that better explains the procedure.

    I've found running Linux on an SSD to be a better experience then under Win7. Then again, that could just be my neck beard talking.
     
  6. Deadjasper

    Deadjasper [H]ard|Gawd

    Messages:
    1,393
    Joined:
    Oct 28, 2001
    It's done. Now I'll have to slog through a month of Sundays to get it configed the way it was. :mad:

    I activated TRIMM (I think), but the instructions on how to test if is garbage. If I follow them verbatim, I get errors. If I deviate, I still get errors. For example, it shows - /dev/sdx. this don't work but it's not too hard to figure out that there has to be space in there. But the starting LBA is trickier, I have no idea which number I'm supposed to use and the writeup only confuses me more. the place where you're supposed to put in the starting LBA is shown as [ADDRESS]. It says nothing about the brackets, do they stay or do they go? anyway, after fighting with it for a while I gave up. I'll either look for an easier way skip it altogether. When it comes to syntax, instructions tend to create more questions than answers. :(
     
  7. deff

    deff 2[H]4U

    Messages:
    2,644
    Joined:
    Feb 20, 2008
    When the tutorial is reference the mounting location of your drive, they used /dev/sdX simply as a place holder. For instance, on my machine, the mounting location of my SSD is /dev/sda and the mounting location of HDD is /dev/sdb, so simply replace /dev/sdX with the real location of your SSD.

    So here's how I'd test TRIM on my drive:

    1. Open a terminal and cd to the root '/' directory. I'm changing to the root directory because all my system files are on my SSD while the home directory and SWAP are on my HDD:
    2. Next, I create a 50mb file filled with random data:
    And here's the output after I've successfully created that file:
    3. Now, using hdparm, I find out what the starting LBA (logical block addressing) for the file, "tempfile", is that I had just created:
    And here's the output from hdparm:
    This is where it gets tricky. Keep in mind, your output will be different than mine. The number you'll want is on the first row, second column (the "begin_lba" column), which for me is the number 1590272 (as I've highlighted in the output above). So, now when we tell hdparm that beginning address:

    hdparm should output the hash for that address:
    All of that randomness means there's data at that location.

    5. Now delete "tempfile" and sync:
    6. Now we check that address again and if TRIM is indeed enabled we should see this:
    All of those zeros mean that the TRIM command was successfully called. If you're still seeing random junk then I would go back through your /etc/fstab and make sure its correctly configured.

    Hope this explains it better!