Hot answers tagged

104

Linux automatically detects SSD, and since kernel version 2.6.29, you may verify sda with: cat /sys/block/sda/queue/rotational You should get 1 for hard disks and 0 for a SSD. See this answer for more information...


74

If you worry about write cycles, you won't get anywhere. You will have data on your SSD that changes frequently; your home, your configs, your browser caches, maybe even databases (if you use any). They all should be on SSD: why else would you have one, if not to gain speed for the things you do frequently? The number of writes may be limited, but a modern ...


39

Naturally, you need to unmount any filesystems on the disk, and it'd be a good idea to deactivate any LVM groups (vgchange -an), and generally make sure nothing is using the disk for anything. Once you've done that, it should be safe to unplug. If you want to be extra cautious, do echo 1 > /sys/block/(whatever)/device/delete first. That'll unregister ...


28

Use smartctl to retrieve vendor information, sudo smartctl -a /dev/sdb If you see a line like this, Rotation Rate: Solid State Device That would be a SSD drive.


23

Ok, so the goal is to get as much bang for the buck as possible - Speed vs. the price of replacement hardware (assuming a single large harddisk and medium-size SSD, which seems to be the norm). To simplify you can to weigh how much you notice the speed increase from moving a file to the SSD against the number of sectors written to move that file to the SSD. ...


16

Bcache could be exactly what you're looking for: Bcache is a Linux kernel block layer cache. It allows one or more fast disk drives such as flash-based solid state drives (SSDs) to act as a cache for one or more slower hard disk drives. I'm eagerly awaiting its inclusion into Linux mainline, but unfortunately it's still not quite there. Some nice and ...


13

With lsblk (part of the util-linux package): lsblk -d -o name,rota NAME ROTA sda 0 sdb 0 sdc 1 where ROTA means rotational device (1 if true, 0 if false)


12

This has been a known issue for awhile. Using an SSD-tuned FS like Btrfs might help, but it might not. Ultimately, it is a bug in the IO scheduler/memory management systems. Recently, there have been some patches that aim to address this issue. See Fixed: The Linux Desktop Responsiveness Problem? These patches may eventually make their way into the ...


12

While it is true that all flash based storage devices have a limited number of writes before the transistor insulation breaks down, it's not as bad as it was when SSDs were first introduced years ago. Basically due to the fact that most modern SSD's employ wear leveling and are based on NandFlash, burning through a drive is not a problem like it used to be. ...


11

In general you can just ignore fragmentation altogether. More so for SSD which do not suffer from seek times like HDD. Defragmenting a SSD will do nothing except waste write cycles. Although there may be extreme cases where fragmentation has a noticable effect, such as a sparse file written to in random order (as some BitTorrent clients do), or when the ...


11

I like hddtemp, which provides a pretty standard way of getting the temperature for supported devices. It requires SMART support though.


11

In your first example, what I think you are referring to is the "Media Wearout Indicator" on Intel drives, which is attribute 233. Yes, it has a range of 0-100, with 100 being a brand new, unused drive, and 0 being completely worn out. According to your ouptut, this field doesn't seem to exist. In your second example, please read the official docs about ...


10

If the SSD is to be your only disk platform, regardless of number of devices, then you have a quandry; how to minimize writes while maintaining reliability and performance. More specifically, ext4, and 3 for that matter, NILFS, and almost any other modern file system will maintain a journal. Ordinarily this is desirable, however, when dealing with SSD ...


10

There is no point in disabling logging because of SSD characteristics. SSD firmwares are even able to distribute repeated writes to the same sector 'wear leveling' - and the specified maximal write cycle count (for each sector) is quite high. For example Hitachi specifies its SSD drives for '10 full drive writes per day for five years'. As a vendor, you ...


10

I would suggest you use udev to set parameters for the SSD disks. This way you can configure a specific queue scheduler that is more appropriate for SSD, etc. You can also apply parameters only to some of the devices, based on a lot of parameters. You can obtain the specific attributes necessary to match your devices (eg. the disk model and manufacturer) by ...


9

On a hybrid solid-state and spinning disk system (like the one I'm typing this), you have two to three aims: Speed up your system: as much commonly used data as possible stays on the SSD. Keep volatile data off the SSD to reduce wear. Optional: have some level of redundancy by using an md(4) (‘software RAID’) setup across the SSD and HDD(s). If you're ...


9

async is the opposite of sync, which is rarely used. async is the default, you don't need to specify that explicitely. The option sync means that all changes to the according filesystem are immediately flushed to disk; the respective write operations are being waited for. For mechanical drives that means a huge slow down since the system has to move the ...


8

Note: These are generalized instructions. Some comments below indicate that your specific distro may or may not have problems with you doing this. That is why the backup in step 4 is recommended. Format SSD. What file system to use on SSD is another question. Boot from a rescue CD and mount up both HD and SSD. rsync -avP /usr from HD to SSD. Move /usr to /...


8

Note that read-ahead can be set at least via /sys (/sys/class/block/sda/queue/read_ahead_kb), blockdev and hdparm (hdparm -a). hdparm on Debian and its derivatives comes with an hdparm.conf that specify per-device attributes to be set on boot, and upon hot-plug (via udev rules). So you can have: /dev/disk/by-id/my-disk... { read_ahead_sect = 4096 } (...


8

Others have mentioned that defragementation might not have an effect on SSD. (I realize this is an old question, but I'd like to add context.) I'd like to advance a stronger version of the same argument: the concept of defragmentation doesn't make any sense for SSD at all. The SSD does not write sequential logical blocks to sequential blocks in flash; in ...


8

I suggest using a different testing method. hdparm is a bit weird as it gives device addresses rather than filesystem addresses, and it doesn't say which device those addresses relate to (e.g. it resolves partitions, but not devicemapper targets, etc.). Much easier to use something that sticks with filesystem addresses, that way it's consistent (maybe except ...


7

bchache might be what you are looking for. It can act as write through or write back cache. ZFS and Btrfs also have features to put more often used blocks on flash storage.


7

I needed to do this on the VPS and none of the provided solutions worked for me, this answer did the trick http://serverfault.com/questions/551453/how-do-i-verify-that-my-hosting-provider-gave-me-ssds/551495#551495 so, it is about reading random data from the drive and assessing the time. time for i in `seq 1 1000`; do dd bs=4k if=/dev/sda count=1 ...


6

Recommended file systems in 2014 Few years have passed since this question was asked and the answers were posted. It's time to post some up to date info on this topic. If anything gets outdated, please post a comment. Since this question was specifically "Is there a file system recommended today for SSD drives?" I will focus on answering that question and ...


6

For ext4 the defragger is called e4defrag. (It's now part of the official e2fsprogs). There's also an fstrim command which should work on both ext4 and (I'd think) xfs. It sends discard requests for unused space on the filesystem. It could be particularly useful if your filesystem was not mounted with -o discard (i.e. sending discards for deleted files ...


6

There is little essential difference between /tmp and /var/tmp in this regard. Step back a bit, though. It is by no means a settled question that you should avoid putting /tmp on an SSD. The earliest SSDs were subject to being worn out by excessive writes, but high quality modern SSDs have solved a lot of this. Partly they do this through wear leveling, and ...


6

For Samsung SSDs, check SMART attribute 177 (Wear Leveling Count). ID # 177 Wear Leveling Count This attribute represents the number of media program and erase operations (the number of times a block has been erased). This value is directly related to the lifetime of the SSD. The raw value of this attribute shows the total count of P/E Cycles. ...


5

Pre-loading a movie to memory probably only matters for network streams or if you don't want your disk respinning. In any case you can try increasing cache size in your media player. With mplayer it can be achieved with following command. mplayer -cache <HUGE_NUMBER_IN_KILOBYTES> <VIDEO_FILE> Usually the problem with slow/choppy video is in ...


5

There is none, and it really doesn't make sense anymore. ReadyBoost was useful for a short period of time when machines were RAM-limited, drives were slow, and flash was cheap. With RAM so cheap now, it makes much more sense to use RAM instead. Typical flash drives these days have write speeds of only about 5MB/s and read speeds of about 20MB/s. Compare ...


5

TRIM is a command that needs to be sent for individual blocks. I have asked the question before (What is the recommended way to empty a SSD?) and it is suggested to use ATA Secure Erase, a command that is sent to the device to clear all data.



Only top voted, non community-wiki answers of a minimum length are eligible