Author Topic: formatting SSD in linux  (Read 4344 times)

Offline Nish

  • Sr. Member
  • ****
  • Posts: 384
    • SMQ's Adventures in Linux
formatting SSD in linux
« on: December 07, 2011, 11:48:08 AM »
I have gotten a little SSD that I am using for my PCLOS install on new build.  I am recycling a SATA HD for cursed windows XP which I am doomed to carry from build to build forever it seems.  Like Jacob Marley's ghost and his chains.

Anyhoo - I am reading up on installing my new little drive and of course everything pertains to windows and windows utilities blah blah.  I am assuming I don't need samsung magician software on the windows side since this is going to be strictly linux on the drive and no windows files system will be tainting it as windows won't even see it (take that windows  :P)

What is preferred way to format a SSD in linux and am I right in assuming that ext4 would be the best file system for it?  I could use my gparted liveCD, right?  I hate to say I have had less than smooth experience with diskdrake  (what comes with PCLOS?)  I am just not as familiar with the interface and have had a couple of goofs that I am sure are my own fault but well, I can't hurt anything with gparted, can I?  It is blank drive so I don't think I could.  I used to use cfdisk in debian before I discovered gparted and if there is some advantage I have missed let me know.

I am also wondering about if I have to do anything to make happy safe environment for an SSD in linux.  I have read about TRIM and putting 'discard' at the end of line in fstab.  I don't think linux does any defragging I would have to turn off.  There is also this "aligning" thing that I THOUGHT was just a windows thing but turns out not http://www.ocztechnologyforum.com/forum/showthread.php?54379-Linux-Tips-tweaks-and-alignment&p=373226#post373226 ??? admittedly over my head.  Prefetch, superfectch?  That anything like prelink in linux?

In windows the mfrs put out software to do all these things so in linux I am on my own except for this wonderful community here and what I can figure out from googling.  As I understand it these SSDs die fast (under XP at least) if they don't have all their little bits and bytes set up the right way and I don't want mine to meet a premature death due to my forever noobness with linux.

Thanks
« Last Edit: December 07, 2011, 12:24:38 PM by Nish »
Never borrow time.  The interest will kill you - signed Mastercard & Visa

Embrace the Bird.  http://www.smqlinux.com - an old lady's adventures in linuxdom

Offline rubentje1991

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2110
  • Rubenus Parvus MCMXCI
Re: formatting SSD in linux
« Reply #1 on: December 07, 2011, 12:26:51 PM »
I also have an SSD...

More info about SSDs in general on the forum here:
http://www.pclinuxos.com/forum/index.php?topic=91054.0
http://www.pclinuxos.com/forum/index.php/topic,84857.0.html
http://www.pclinuxos.com/forum/index.php/topic,89980.0.html
http://www.pclinuxos.com/forum/index.php/topic,83629.msg694995.html#msg694995
=> noatime to lower the writes to the drive

While googling:
http://www.ocztechnologyforum.com/forum/showthread.php?54379-Linux-Tips-tweaks-and-alignment&p=373226#post373226
http://www.nuclex.org/blog/personal/80-aligning-an-ssd-on-linux
=> I have read this 2 advices, but not applied  :-X :D

http://tombuntu.com/index.php/2008/09/04/four-tweaks-for-using-linux-with-solid-state-drives/
=> this I tried, I don't know if it's still working like that on my system

http://techgage.com/article/enabling_and_testing_ssd_trim_support_under_linux/
=> this I've done to enable TRIM support; but the test flawed [it was working, but the test 'approved' it didn't  ::) :P] (different sector size, which I didn't know at that time)

If there would be any problems recognizing the drive (but I think that's no problem most of the time  :)):
http://www.pclinuxos.com/forum/index.php/topic,91054.msg787231.html#msg787231

http://andyduffell.com/techblog/?p=852
=> this is the test I ultimately tried after enabling TRIM; when choosing the right sector, I was approved TRIM was working (first it contained data, and afterwards only zeros  :)) - this testing method is better in my opinion  8)


I'd say, try one - and I hope it works beautiful for you  ;)


PS: here some other info, but nothing I really used (more background info....):
https://bbs.archlinux.org/viewtopic.php?pid=987136

Offline nid

  • Jr. Member
  • **
  • Posts: 17
Re: formatting SSD in linux
« Reply #2 on: December 14, 2011, 07:17:43 PM »
This very system I am using right now have 3 SSD installed

/dev/sda OCZ 120.0GB
/dev/sdc C300 64.0GB (Crucial)
/dev/sdd C300 64.0GB (Crucial)

I am using gparted to do all of my formatting work and partitioning stuff.  I don't do anything much to baby my SSD. I just making sure to put my /home directories on the platter hard drives.  I have 5 Linux distro plus Windows 7 installed so I have 5 separate home directories for each linux distro and data for my Windows 7 on platter hard drive.

You just make sure no swap on SSD drive and no hibernate file on the SSD drive.  So you won't be constantly write to SSD drive(s).  Gparted gave me a perfect alignment, no problem at all.  I don't worry about TRIM or garbage collection since I don't writing and deleting much on the SSD drives.  Even if I do, the amount of data writing and deleting won't use up all of my NAND blocks for the next 80 years per my calculation :D

Just install it and enjoy the speed :D
« Last Edit: December 14, 2011, 07:21:45 PM by nid »

Offline Nish

  • Sr. Member
  • ****
  • Posts: 384
    • SMQ's Adventures in Linux
Re: formatting SSD in linux
« Reply #3 on: December 15, 2011, 03:02:33 AM »
I would have to ask, since you don't have home or swap on there it is just system files?  My home is going to be on the SSD and I really couldn't decide about the swap as I never touch it with only 2GB of RAM and the new build will have 4GB - I figured it was a moot point where to put it although I didn't want to sacrifice 8GB of space on the drive for it.  I wouldn't put a windows swap on an SSD ever of course but my linux one is all lonely and unloved  ;)

I am not sure about firefox cache, I have heard a lot about that killing the earlier SSDs at least when they didn't have garbage collection Ithink.
Never borrow time.  The interest will kill you - signed Mastercard & Visa

Embrace the Bird.  http://www.smqlinux.com - an old lady's adventures in linuxdom

Offline pags

  • Hero Member
  • *****
  • Posts: 2515
  • Keep it clean.
Re: formatting SSD in linux
« Reply #4 on: December 15, 2011, 12:59:09 PM »
I would have to ask, since you don't have home or swap on there it is just system files?  My home is going to be on the SSD and I really couldn't decide about the swap as I never touch it with only 2GB of RAM and the new build will have 4GB - I figured it was a moot point where to put it although I didn't want to sacrifice 8GB of space on the drive for it.  I wouldn't put a windows swap on an SSD ever of course but my linux one is all lonely and unloved  ;)

I am not sure about firefox cache, I have heard a lot about that killing the earlier SSDs at least when they didn't have garbage collection Ithink.

It really comes down to (your anticipated) usage, and only you know what that is... :(

I can say that I'm running an EeePC 701 from a 16GB SD card, bumped up to 2GB RAM (max).  It has no swap, and /tmp is in RAM, and it run KDE OK.

Code: [Select]
[jpaglia@eeepc ~]$ free
             total       used       free     shared    buffers     cached
Mem:       2065228    1553032     512196          0     112916     962856
-/+ buffers/cache:     477260    1587968
Swap:            0          0          0
[jpaglia@eeepc ~]$ df
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1              15G  5.5G  8.5G  40% /
none                 1009M  109M  900M  11% /tmp
[jpaglia@eeepc ~]$

Everything (/home, /var, ...) is in / (root).
FWIW...

Offline nid

  • Jr. Member
  • **
  • Posts: 17
Re: formatting SSD in linux
« Reply #5 on: December 15, 2011, 01:19:01 PM »
I do have /home directories but they are not on any of my SSD drives.  They are located on my platter hard drive.  If you have platter hard drive you should move /home directory and place it there.  Not sure if you already install the OS or not.  You can tell the installer where you want /home directory to be during the installation. Or you can easily move it to the new location/partition later if you want.

For example. The computer I am using right now have PCLinuxOS installed on /dev/sda3 (my OCZ Vortex 3) having / as mount point but my /home directory is on /dev/sdb3 (my 1TB platter drive).

/dev/sda3              15G  3.1G   11G  23% /
/dev/sdb3              50G   11G   37G  23% /home


I don't cache anything much nowaday since the dial-up days are long gone. I'm on a decent pipe 30 up 30 down.

For the SWAP I don't have it.  I have never a reason to have it, not for what I do at home anyway.  One of my computer at home have 2GB of RAM I still didn't have the need for it.

« Last Edit: December 15, 2011, 01:20:56 PM by nid »

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2431
  • Any Bugs in site?
Re: formatting SSD in linux
« Reply #6 on: February 01, 2012, 06:28:37 PM »
nid

Having multiple SSD I would love to see the result of fdisk -l  if you can spare the time to post it.   :)
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen