Ads
Tom's Guide > Forum > Linux/Free BSD > General Discussion > [Solved] SSD optimisation in SL 6.1

[Solved] SSD optimisation in SL 6.1

Forum Linux/Free BSD : General Discussion [Solved] SSD optimisation in SL 6.1

Related Content
Can't find your answer?
Ask!

Best answer from PreferLinux.

Word :    Username :           
 

You all know I don't know all that much about Linux, possibly even less about terminal.

 

Well...

 

I want to enable TRIM, disable swap/tmp if possible and optimise my SSD for Linux according to an article in APC. Here's a little background...

 

Scientific Linux 6.1 + all updates, Crucial m4 64GB SSD.

 

You might notice this thread being on the APC forum. That's because I'm asking on behalf of that user I know irl.

 
Code :
  1. [strayfire@Katyr ~]$ su
  2. Password:
  3. [root@Katyr strayfire]# fdisk -l
  4. Disk /dev/sda: 64.0 GB, 64022175232 bytes
  5. 255 heads, 63 sectors/track, 7783 cylinders
  6. Units = cylinders of 16065 * 512 = 8225280 bytes
  7. Sector size (logical/physical): 512 bytes / 512 bytes
  8. I/O size (minimum/optimal): 512 bytes / 512 bytes
  9. Disk identifier: 0x4fa3da4e
  10.   Device Boot      Start        End      Blocks  Id  System
  11. /dev/sda1  *          1          64      512000  83  Linux
  12. Partition 1 does not end on cylinder boundary.
  13. /dev/sda2              64        7784    62008320  8e  Linux LVM
  14. Disk /dev/mapper/vg_katyr-lv_root: 30.3 GB, 30270291968 bytes
  15. 255 heads, 63 sectors/track, 3680 cylinders
  16. Units = cylinders of 16065 * 512 = 8225280 bytes
  17. Sector size (logical/physical): 512 bytes / 512 bytes
  18. I/O size (minimum/optimal): 512 bytes / 512 bytes
  19. Disk identifier: 0x00000000
  20. Disk /dev/mapper/vg_katyr-lv_root doesn't contain a valid partition table
  21. Disk /dev/mapper/vg_katyr-lv_swap: 10.1 GB, 10133438464 bytes
  22. 255 heads, 63 sectors/track, 1231 cylinders
  23. Units = cylinders of 16065 * 512 = 8225280 bytes
  24. Sector size (logical/physical): 512 bytes / 512 bytes
  25. I/O size (minimum/optimal): 512 bytes / 512 bytes
  26. Disk identifier: 0x00000000
  27. Disk /dev/mapper/vg_katyr-lv_swap doesn't contain a valid partition table
  28. Disk /dev/mapper/vg_katyr-lv_home: 23.1 GB, 23089643520 bytes
  29. 255 heads, 63 sectors/track, 2807 cylinders
  30. Units = cylinders of 16065 * 512 = 8225280 bytes
  31. Sector size (logical/physical): 512 bytes / 512 bytes
  32. I/O size (minimum/optimal): 512 bytes / 512 bytes
  33. Disk identifier: 0x00000000
  34. Disk /dev/mapper/vg_katyr-lv_home doesn't contain a valid partition table
  35. [root@Katyr strayfire]#
 

From the magazine I'm reading (APC Feb 2012; Linux Mint 12):

 
Quote :

No distributions enable it (TRIM) by default, but it's simple to do by adding the 'discard' flag to any mounted SSDs. To make these changes, open up terminal and run:

 

sudo nano -w /etc/fstab

 

Then for all SSD devices remove 'relatime' if present and add 'noatime, nodiratime,discard' so it looks something like:

 

dev/sda / ext4
noatime, nodiratime,discard,errors=remount-ro 0 1

 

So where would I put it on my etc/fstab? Do I just copy and paste it somewhere??

 
Code :
  1. # /etc/fstab
  2. # Created by anaconda on Fri Feb  3 04:43:17 2012
  3. #
  4. # Accessible filesystems, by reference, are maintained under '/dev/disk'
  5. # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
  6. #
  7. /dev/mapper/vg_katyr-lv_root /                      ext4    defaults        1 1
  8. UUID=44b1e55b-616c-454e-82f7-6d3e2b82399f /boot                  ext4    defaults        1 2
  9. /dev/mapper/vg_katyr-lv_home /home                  ext4    defaults        1 2
  10. /dev/mapper/vg_katyr-lv_swap swap                    swap    defaults        0 0
  11. tmpfs                  /dev/shm                tmpfs  defaults        0 0
  12. devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
  13. sysfs                  /sys                    sysfs  defaults        0 0
  14. proc                    /proc                  proc    defaults        0 0
 


If there is a more elegant way of no having tmp/swap requires a re-installation/repartition manually to regain disk space, I'm really not that worried. Thanks all.


Message edited by amdfangirl on 02-02-2012 at 11:23:25 AM
------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl
Register or log in to remove.
Best answer

Code :
  1. #lvremove vg_katyr/lv_swap
  2. #lvextend vg_katyr/lv_home
  3. #resize2fs /dev/mapper/vg_katyr-lv_home


should deal with the swap partition (first to remove the swap LV, second to resize the home LV, and third to resize the filesystem). Remove line 10 of /etc/fstab as well. You may well have to do it from a bootable CD/DVD/USB. And no guarantees that it will work – it came from "man lvm" (to find the utilities, then their man pages for details) and "man -k ext4" (to find out it was resize2fs I was looking for, then man resize2fs for details).

 

Then lines seven through nine of /etc/fstab will need "defaults" changing to "defaults,noatime,nodiratime,discard".

Message quoted 1 times
Message edited by PreferLinux on 02-03-2012 at 04:27:53 AM
------------------------------ i5 2500K, GA-P67A-UD3R, 12 GB RAM, 1 TB Spinpoint F3 & 250 GB WD HDDs, DVD writer, Dell U2311H 23", Philips 170B6 17" & Philips 150B4 15" monitors, Dvorak keyboard, openSUSE 11.4 with Windows Vista Ultimate in a VB VM.

Rom. 3:23; 6:23; 5:8; 10:9-10,13
Reply to PreferLinux

PreferLinux wrote :



Then lines seven through nine of /etc/fstab will need "defaults" changing to "defaults,noatime,nodiratime,discard".



I just realised that from research I was doing lol.Just was about to post it haha.

------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl

After reading over the RHEL storage admin guide, I ended up with:

 

sda (SSD)
sda1 / Rest of space
sda2 /boot 500MB
Free Space 2 MB

 

sdb (HDD)
sdb1 /home Rest of space
sdb2 /tmp 200MB
Free Space 2MB

 

I chose not to have swap because I could never use all of my 8GB of RAM in Windows 7 (no pagefile and more of a memory hog) anyway. :)

 

I will flag the SSD with defaults,noatime etc. after I finish the reinstallation. Thanks mate!


Message edited by amdfangirl on 02-03-2012 at 08:40:44 AM
------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl

Best answer selected by amdfangirl.

------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl

This topic has been closed by Amdfangirl

------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl
TomsGuide.com: Over 800,000 questions and answers to address all your high-tech questions. Sign up now! Its free!
Tom's Guide > Forum > Linux/Free BSD > General Discussion > [Solved] SSD optimisation in SL 6.1
Go to:

There are 41 identified and unidentified users. To see the list of identified users, Click here.

Tom's Guide around the World