SSD clarification (newbie on tweaks, swap file, dual boot)

Archived topics about LMDE 1 and LMDE 2
Locked
itemonhold

SSD clarification (newbie on tweaks, swap file, dual boot)

Post by itemonhold »

I am going to install/dual boot LMDE and Windows 7 using one (1) SSD. No other storage/drives. I have read through existing threads here and elsewhere, but feel I need to get things verified as this is new territory (I'm upgrading from a 9-10 year old system). I really appreciate any comments you can give me. So far I know for certain that I will go for EXT4 and either noop or deadline.

New system
SSD: 240 GB (Sandisk Extreme)
Ram: 8 (2x4) GB
Mobo: Z77 (Asrock Z77E-ITX)


Q1
I read a lot about "noatime" and will try to implement it. However, what does this exactly deactivate? Just the information when a file has been read, e.g. the info I see when I right click on a file and see when it has last been "accessed"? Or will implementing "noatime" have other small impacts on other features, e.g. not getting a list of most recently listened songs in audio players (assuming listening does not equal that data is actually written - I might be wrong here?)? I am not sure if want those kind of features to be disabled (the same reason why I won't put Firefox cache in tmp).

Q2
I have read many recommendations about ditching the swap partition when dealing with a SSD. While using my new system with 8 gb ram, I believe I will barely or not at all need swap. (I'm currently running on 2 gb ram and using the "top" command it seems that I'm not touching my swap partition). Most of the time I would be happy to just suspend to ram (and shut down, obviously). I do, however, want to have the ability to hibernate (suspend to disk=ssd). If not creating a swap partition, is a swap file a good solution (as reliable as a partition) for the occasions when I, crazy as I am, want to hibernate? I read contradicting information on the behaviour of swap files (and their sizes). Will the size of the swap file be consistent (maximum, given a certain size) or vary depending on how much swap is actually needed? If the swap file actually always is as large as some given size value is there any point using it over a swap partition? But if the size of the swap file is dynamic in relation to the actual need, it would perhaps be the way to go?

Q3
What is the best solution to share space between two OSs, i.e. LMDE and Windows 7? In my current setup (LMDE and Windows XP on 1 HDD in total) I use a windows formatted (ntfs) partition which is accessible from both OSs. Is there any other/better solutions? Should one also assign discards/noatime in LMDE to the windows formatted partition?

Q4
What about journaling? No big reason to turn it off?

I apologise if this all too much to begin with...
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: SSD clarification (newbie on tweaks, swap file, dual boo

Post by xenopeek »

Awesome build, sounds like this will a blazingly fast system :D On to the questions!

A1
noatime disables writing a timestamp to disk each time a file is accessed (read or write). This is used by some, I believe older, backup programs but not by much else. I've been running with noatime for 4 years now, and have found no issues. Generally your applications will update a "recently used files" list, either the system wide list or an application specific list. noatime doesn't affect this.

A2
As with a SSD I boot in 6 seconds (okay the BIOS drags it feet for 20 seconds or so before that), I've never seen the use for hibernate or sleep on my desktop. At least on the Ubuntu based Linux Mint you are required to have a swap partition if you want to hibernate, as it can't hibernate to a swap file on an active partition. Not sure how that is for Debian based Linux Mint, but probably a partition is best as I believe that is generally recommend to be more stable. Also, a swap file would be a fixed size anyway. With 8 GiB RAM you would need a swap partition of at least 8 GiB also to be able to hibernate.

I'd recommend you set swappiness to 10 (default is 60 I believe), to delay swapping for as long as possible, so it will basically only be used for hibernate. With the default higher swappiness setting the kernel will work to keep a larger portion of your RAM free for use by applications, by pro-actively swapping out RAM contents to disk earlier. The upside of this is you don't waste write cycles on your SSD, the downside is that should you manage to have your applications need more than 8 GiB RAM then with the lower swappiness setting your system may "hiccup" and be shortly slow as it spews out RAM contents to disk in haste to make room at the last minute...

A3
Not using Windows, only operating systems that play nice with eachother, so don't know :)

A4
Some have been recommend to use Ext2 (which doesn't have journaling) or a more modern filesystem and disable journaling. Journaling is what keeps your filesystem consistentm in case of force majeure, so I would leave it enabled and use a modern filesystem (i.e., the default Ext4).

Some additional things you can do, with 8 GiB RAM, is mount /tmp into RAM so any temporary files aren't written to disk. And if you have a broadband Internet connection, you might consider also moving your web browser's disk cache to /tmp. Edit your /etc/fstab file to start with that:

Code: Select all

gksudo gedit /etc/fstab
Add the following line:

Code: Select all

none /tmp     tmpfs nodev,nosuid,mode=1777 0 0
Save & close this file. Then run the following two commands to activate the changes.

Code: Select all

sudo rm -rf /tmp/*
sudo mount -a
Then you'll want to start Firefox, type in the address bar:

Code: Select all

about:config
And hit enter. Accept the warning and continue. Right click on an empty part, and select New -> String from the context menu that popped up. Enter:

Code: Select all

browser.cache.disk.parent_directory
And give it the value:

Code: Select all

/tmp
This makes the Firefox cache also be stored in memory instead of on disk.
Image
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Re: Re: SSD clarification (newbie on tweaks, swap file, dual

Post by marcus0263 »

itemonhold wrote:I am going to install/dual boot LMDE and Windows 7 using one (1) SSD. No other storage/drives. I have read through existing threads here and elsewhere, but feel I need to get things verified as this is new territory (I'm upgrading from a 9-10 year old system). I really appreciate any comments you can give me. So far I know for certain that I will go for EXT4 and either noop or deadline.

New system
SSD: 240 GB (Sandisk Extreme)
Ram: 8 (2x4) GB
Mobo: Z77 (Asrock Z77E-ITX)


Q1
I read a lot about "noatime" and will try to implement it. However, what does this exactly deactivate? Just the information when a file has been read, e.g. the info I see when I right click on a file and see when it has last been "accessed"? Or will implementing "noatime" have other small impacts on other features, e.g. not getting a list of most recently listened songs in audio players (assuming listening does not equal that data is actually written - I might be wrong here?)? I am not sure if want those kind of features to be disabled (the same reason why I won't put Firefox cache in tmp).
noatime doesn't update access time of the file, hit your man pages for explanation

man fstab

Q2
I have read many recommendations about ditching the swap partition when dealing with a SSD. While using my new system with 8 gb ram, I believe I will barely or not at all need swap. (I'm currently running on 2 gb ram and using the "top" command it seems that I'm not touching my swap partition). Most of the time I would be happy to just suspend to ram (and shut down, obviously). I do, however, want to have the ability to hibernate (suspend to disk=ssd). If not creating a swap partition, is a swap file a good solution (as reliable as a partition) for the occasions when I, crazy as I am, want to hibernate? I read contradicting information on the behaviour of swap files (and their sizes). Will the size of the swap file be consistent (maximum, given a certain size) or vary depending on how much swap is actually needed? If the swap file actually always is as large as some given size value is there any point using it over a swap partition? But if the size of the swap file is dynamic in relation to the actual need, it would perhaps be the way to go?
you still need a swap, put it on a spinning disk if you've got one. I also would only keep the swap around 1 gig at most. Also in your /etc/sysctl.conf adjust the swappiness, add this to the end

vm.swappiness = 10

This will significantly cut down your swap usage.
Q3
What is the best solution to share space between two OSs, i.e. LMDE and Windows 7? In my current setup (LMDE and Windows XP on 1 HDD in total) I use a windows formatted (ntfs) partition which is accessible from both OSs. Is there any other/better solutions? Should one also assign discards/noatime in LMDE to the windows formatted partition?
Just have a slice configured for NTFS and mount it in your fstab
Q4
What about journaling? No big reason to turn it off?
I slice up my drive like this using ext4 on all

/boot (256 MB)
/ (8 GB)
/tmp (5 GB)
/var/log (256 MB)
/home (the rest)

On my spinning drive I have
swap
/home/myusername/.Stuff

I then do a symlink from my home dir to /home/username/.Stuff

Pictures
Documents
Downloads
Videos

I turn off journaling for tmp and log
I have noatime for boot, tmp and log
I have relatime for / and home (including the .Stuff slice)

Also remember to have "discard" selected for all of your slices that are on the SSD.

Additionally for all but boot (doesn't like it) I have the option

inode_readahead_blks=64

I apologise if this all too much to begin with...
No worries, it's a learning process and slicing up your drive you just need to mess about with it for a while. Most people are lazy (IMO) to slice up the drive but trust me when you get a stuck daemon flooding he logs or you download too much and corrupt your file system you'll thank me ;)


Sent from my Android tablet w/ Tapatalk HD
Shuttle SX58
Intel i7 Gulftown Hex Core
G.Skill 16Gig 1333
OCS Vertex 2 SSD
Segate SATA II
Palit GeForce GTS 450
LMKDE 14 64Bit

Where Thought Crime is Committed
Reject the Herd
itemonhold

Re: SSD clarification (newbie on tweaks, swap file, dual boo

Post by itemonhold »

First off, I gotta say it's so nice that you guys respond with so much enthusiasm :) Thanks for clarifying my questions!
xenopeek wrote:Awesome build, sounds like this will a blazingly fast system :D On to the questions!
Thanks! In addition to the already mentioned components, I'm going with an i3-3225 and a small mini-itx case with an external psu. Aiming at a small/silent system without compromising speed (too much).
xenopeek wrote: I've been running with noatime for 4 years now, and have found no issues.
Do you mean without? At least in the thorough post I've seen referenced a few times :)
xenopeek wrote: a swap file would be a fixed size anyway. With 8 GiB RAM you would need a swap partition of at least 8 GiB also to be able to hibernate.
Ok, I see. Partition sounds better. One reason for my desire to hibernate is prior experiences with suspend vs hibernate with my older system. This might, however, not be that relevant anymore... Hm, If one on an 8 GiB RAM system only suspends to ram, one could probably manage without a swap partition or perhaps at least with a swap partition that is smaller than RAM (e.g. 8 GiB RAM and 2 GiB swap partition)? Depends obviously on use, but in my case I believe 8 GiB RAM offers me plenty, hence use of swap would be minimal.
xenopeek wrote: Some additional things you can do, with 8 GiB RAM, is mount /tmp into RAM so any temporary files aren't written to disk. And if you have a broadband Internet connection, you might consider also moving your web browser's disk cache to /tmp.
I will do this, thanks! Though I think I will leave my web browser's cache on the disk (ssd) as I prefer to have it also after reboot.
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: SSD clarification (newbie on tweaks, swap file, dual boo

Post by xenopeek »

itemonhold wrote: xenopeek wrote: I've been running with noatime for 4 years now, and have found no issues.


Do you mean without? At least in the thorough post I've seen referenced a few times :)
No, I've been running with noatime :) Which means "no atime"; it disables writing access times to the filesystem. I've been running without atime :wink:
Image
itemonhold

Re: SSD clarification (newbie on tweaks, swap file, dual boo

Post by itemonhold »

xenopeek wrote:
itemonhold wrote: xenopeek wrote: I've been running with noatime for 4 years now, and have found no issues.


Do you mean without? At least in the thorough post I've seen referenced a few times :)
No, I've been running with noatime :) Which means "no atime"; it disables writing access times to the filesystem. I've been running without atime :wink:
Of course :lol:
itemonhold

Re: Re: SSD clarification (newbie on tweaks, swap file, dual

Post by itemonhold »

marcus0263 wrote: I slice up my drive like this using ext4 on all

/boot (256 MB)
/ (8 GB)
/tmp (5 GB)
/var/log (256 MB)
/home (the rest)

On my spinning drive I have
swap
/home/myusername/.Stuff

I then do a symlink from my home dir to /home/username/.Stuff

Pictures
Documents
Downloads
Videos

I turn off journaling for tmp and log
I have noatime for boot, tmp and log
I have relatime for / and home (including the .Stuff slice)
Thanks, seems like good advice! And would probably make future re-installs more easy, e.g. keeping /home intact.
Locked

Return to “LMDE Archive”