Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Optimize installation on new SSD

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
newtimes333
Posts: 5
Joined: 2016-11-25 18:57

Optimize installation on new SSD

#1 Post by newtimes333 »

Hello.

First of all, I really like Debian GNOME! Stable and good looking. This is also the only OS where I've managed to get both graphics and WIFI to work at the same time (windows included). AMD Radeon...

I just bought a Kingston SSDNow UV400 120GB SSD to put inside my 3 year old HP Pavilion Laptop.

Can I just do the official netinst for the "stable" release and what it suggest regarding partitions and so on? I've read that SSD work better with certain disk partition types. Also read somewhere that you should leave some free diskspace on the drive.

How would you optimize this disk for Debian? I will only use it on this compute so no dual boot and so on.

Cheers.

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Optimize installation on new SSD

#2 Post by RU55EL »

I suggest you do some reading in the Debian Administrators Handbook.

Assuming no UEFI, my preference would be GPT partition table, 20G root partition, 4G swap (adjusted as needed to match RAM), and the remainder as /home partition. Read the section on partitioning in the Debian Handbook. It will explain the Debian installation choices.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Optimize installation on new SSD

#3 Post by pylkko »

In the wiki there is page called SSD optimization.

newtimes333
Posts: 5
Joined: 2016-11-25 18:57

Re: Optimize installation on new SSD

#4 Post by newtimes333 »

That was a nice handbook, thanks RU55EL!

My PC has UEFI and I've secure boot disabled.

I know about the choice “All files in one partition”, this is how I use another disk now with Debian. Never did a manual partition.

Should I use 20GB root partition, 8GB swap (I have 8GB RAM) and the rest for the /home partition then. And no free space?

Ext4 filesytem is recommended according to the wiki. So all partitions in ext4?

Sorry guys for the maybe stupid questions. I would just love to get it right from the beginning this time. Installed maybe 10 different OS:es in the last month, more than once... :oops: Also read somewhere that you couldn't use the SSD to it's potential or even damage it if you picked the wrong stuff.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Optimize installation on new SSD

#5 Post by bw123 »

There are a lot of threads about ssd, but I don't think the forum search will find three letters, maybe try search for "solid state" instead. Lot of people have made the switch.

I never did an install, but I did clone my system over to ssd a few months ago. I used fdisk, it looks like this

Code: Select all

# fdisk -l

Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb54f27ac

Device     Boot    Start       End   Sectors  Size Id Type
/dev/sda1  *        2048     83967     81920   40M  6 FAT16
/dev/sda2          83968   4483071   4399104  2.1G 82 Linux swap / Solaris
/dev/sda3        4483072  67397631  62914560   30G 83 Linux
/dev/sda4       67397632 234441647 167044016 79.7G  5 Extended
/dev/sda5       67399680 193228799 125829120   60G 83 Linux

The installer probably uses a partitioner called partman, also in debian is one called cfdisk, which I used to use, I like it very much, but it sets the start of 1st partition to 63 instead of 2048, which I think would be an error. I think the start of first partition will be the important thing for you to set right. The rest of the stuff like partition size probably won't matter, I partitioned all available space. Some research says to leave some space unallocated, but it's vague about how over provisioning works. The phenomenon it mentions is 'wear leveling' so maybe check that out before you do your work.

Good info is hard to find, but kingston may have some tips, I'd try them first.

Don't forget to make arrangements for trim. There are at least two ways to do it.

Package smartmontools will give you the lowdown after you install it, you should wait a few minutes before rebooting because some of these devices will start a smart test automatically when they receive it's first smart command.
resigned by AI ChatGPT

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Optimize installation on new SSD

#6 Post by RU55EL »

newtimes333 wrote:That was a nice handbook, thanks RU55EL![...]
Should I use 20GB root partition, 8GB swap (I have 8GB RAM) and the rest for the /home partition then. And no free space?
Ext4 filesytem is recommended according to the wiki. So all partitions in ext4? [...].
I create a GPT partition table.

Then use at least 20G for the root partition in ext4.

If I have 8G of ram, I set the swap for 8G in "swap" file system.

The remainder I would partition as /home in ext4.

As long as the SSD doesn't have anything you want to loose on it, try guided partitioning with separate /home and see what Debian sets up. You can adjust the partition sizes to suit your preferences.

I usually boot with a gparted live disk and create the GPT partition table and the base partitions. Then boot from the Debian installation USB or CD and just set up what I want each partition for manually partition set up.

If you get fed up, you can just let Debian guided partitioning do the partitioning for you.

[edit]

Here is an example from my old Dell Latitude D530 with 4G ram and a 120G SSD:

Code: Select all

russel@d530:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 119.2G  0 disk 
├─sda1   8:1    0    20G  0 part /
├─sda2   8:2    0     4G  0 part [SWAP]
└─sda3   8:3    0  95.2G  0 part /home

Code: Select all

russel@d530:~$ sudo fdisk -l
[sudo] password for russel: 

Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8050826F-6C6F-4590-B3BC-56C764858FEB

Device        Start       End   Sectors  Size Type
/dev/sda1      2048  41945087  41943040   20G Linux filesystem
/dev/sda2  41945088  50333695   8388608    4G Linux swap
/dev/sda3  50333696 250068991 199735296 95.2G Linux filesystem

newtimes333
Posts: 5
Joined: 2016-11-25 18:57

Re: Optimize installation on new SSD

#7 Post by newtimes333 »

Thanks for your inputs.

I guess I will have to try it out. I've gotten a bit smarter now.

It just feels like there is so many different answers out there. Like swap for example to. Some say don't use it on a SSD if you have enough RAM.

I've both read on Kingston's homepage that my SSD supports TRIM and on some forum that you should not use it because it inflicts with the build in garbage control or something like it.

This guy sums it up quite well to me and gives some tips on optimizing TRIM and SWAP:
https://www.youtube.com/watch?v=jfmxnYkHTNU and https://www.youtube.com/watch?v=ovjl9Ki-EFg

I will follow your suggestions and use the optimizing methods from the link above.This is just a cheap SSD that I will put in a old laptop. The laptop will probably die before the SSD anyhow.

I still like to understand how it works though and what's the right way of doing things. :)
.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Optimize installation on new SSD

#8 Post by Head_on_a_Stick »

deadbang

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Optimize installation on new SSD

#9 Post by Segfault »

8 GB of RAM > 8 GB of swap? What a nonsense. Unless you want to hibernate, do you?

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Optimize installation on new SSD

#10 Post by RU55EL »

8G ram = 8G swap

True, this is really not needed. I can't remember the last time one of my computers used any swap space. In my experience Debian rarely uses more than about 1G of ram as it is. Matching the swap size with the ram size should allow hibernation without problems.

Code: Select all

russel@debian-nuc:~$ sudo ps_mem.py
 Private  +   Shared  =  RAM used	Program

124.0 KiB +  20.5 KiB = 144.5 KiB	minissdpd
144.0 KiB +  35.5 KiB = 179.5 KiB	cat
164.0 KiB +  36.0 KiB = 200.0 KiB	gnome-pty-helper
192.0 KiB +  26.0 KiB = 218.0 KiB	acpid
212.0 KiB +  18.0 KiB = 230.0 KiB	start-pulseaudi
200.0 KiB +  53.5 KiB = 253.5 KiB	atd
300.0 KiB +  60.5 KiB = 360.5 KiB	rtkit-daemon
260.0 KiB + 121.5 KiB = 381.5 KiB	rpc.idmapd
316.0 KiB +  80.0 KiB = 396.0 KiB	dbus-launch
324.0 KiB +  75.0 KiB = 399.0 KiB	cron
568.0 KiB +  19.5 KiB = 587.5 KiB	ssh-agent
480.0 KiB + 167.0 KiB = 647.0 KiB	rpcbind
640.0 KiB + 175.0 KiB = 815.0 KiB	at-spi-bus-launcher
652.0 KiB + 165.0 KiB = 817.0 KiB	rpc.statd
600.0 KiB + 254.0 KiB = 854.0 KiB	agetty (4)
668.0 KiB + 189.0 KiB = 857.0 KiB	gconfd-2
756.0 KiB + 104.0 KiB = 860.0 KiB	dnsmasq
800.0 KiB +  61.0 KiB = 861.0 KiB	systemd-logind
416.0 KiB + 531.0 KiB = 947.0 KiB	avahi-daemon (2)
748.0 KiB + 200.0 KiB = 948.0 KiB	at-spi2-registryd
804.0 KiB + 165.0 KiB = 969.0 KiB	gvfs-mtp-volume-monitor
860.0 KiB + 111.0 KiB = 971.0 KiB	dconf-service
804.0 KiB + 203.0 KiB =   1.0 MiB	gvfs-goa-volume-monitor
808.0 KiB + 218.0 KiB =   1.0 MiB	gvfsd-burn
824.0 KiB + 220.0 KiB =   1.0 MiB	gvfsd
  1.1 MiB +  72.5 KiB =   1.2 MiB	bluetoothd
  1.0 MiB + 176.0 KiB =   1.2 MiB	gvfsd-fuse
  1.0 MiB + 203.5 KiB =   1.2 MiB	gvfs-gphoto2-volume-monitor
  1.3 MiB +  94.0 KiB =   1.4 MiB	exim4
  1.1 MiB + 338.5 KiB =   1.4 MiB	gvfs-afc-volume-monitor
  1.2 MiB + 242.0 KiB =   1.5 MiB	gvfsd-trash
  1.4 MiB + 167.0 KiB =   1.5 MiB	accounts-daemon
  1.4 MiB + 249.5 KiB =   1.6 MiB	gdm3
  1.2 MiB + 428.5 KiB =   1.7 MiB	sshd
  1.2 MiB + 445.0 KiB =   1.7 MiB	upowerd
  1.6 MiB +  99.5 KiB =   1.7 MiB	systemd-udevd
  1.4 MiB + 402.0 KiB =   1.8 MiB	zeitgeist-daemon
  1.0 MiB + 780.0 KiB =   1.8 MiB	sudo (2)
  1.2 MiB + 764.5 KiB =   1.9 MiB	(sd-pam)
  1.9 MiB +  75.5 KiB =   2.0 MiB	rsyslogd
  1.7 MiB + 429.0 KiB =   2.1 MiB	gvfs-udisks2-volume-monitor
  1.5 MiB + 548.0 KiB =   2.1 MiB	gsd-printer
  1.8 MiB + 345.5 KiB =   2.1 MiB	udisksd
  1.7 MiB + 586.0 KiB =   2.3 MiB	openvpn
  1.9 MiB + 552.0 KiB =   2.4 MiB	x-session-manag
  2.0 MiB + 438.5 KiB =   2.5 MiB	gnome-keyring-daemon
  2.4 MiB +  92.5 KiB =   2.5 MiB	xprop
  2.3 MiB + 382.0 KiB =   2.7 MiB	gdm-session-worker
  2.5 MiB + 173.5 KiB =   2.7 MiB	polkitd
  2.6 MiB + 164.0 KiB =   2.7 MiB	gvfsd-metadata
  2.2 MiB + 557.0 KiB =   2.7 MiB	tracker-miner-user-guides
  2.3 MiB + 598.5 KiB =   2.8 MiB	wpa_supplicant
  2.1 MiB + 986.5 KiB =   3.0 MiB	mission-control-5
  2.8 MiB + 557.5 KiB =   3.3 MiB	packagekitd
  2.7 MiB + 656.0 KiB =   3.3 MiB	tracker-miner-apps
  3.0 MiB + 365.0 KiB =   3.3 MiB	ModemManager
  1.7 MiB +   1.7 MiB =   3.4 MiB	systemd (2)
  3.5 MiB + 652.5 KiB =   4.2 MiB	dbus-daemon (3)
  3.0 MiB +   1.3 MiB =   4.4 MiB	gnome-shell-calendar-server
  3.7 MiB + 862.0 KiB =   4.5 MiB	NetworkManager
  3.6 MiB +   1.2 MiB =   4.8 MiB	gsd-locate-pointer
  3.9 MiB +   1.1 MiB =   5.1 MiB	bash (2)
  4.7 MiB + 516.0 KiB =   5.2 MiB	colord
  3.7 MiB +   1.7 MiB =   5.4 MiB	evolution-source-registry
  4.8 MiB + 862.5 KiB =   5.7 MiB	pulseaudio
  5.5 MiB + 789.0 KiB =   6.3 MiB	zeitgeist-datahub
  6.4 MiB +  99.0 KiB =   6.5 MiB	systemd-journald
  6.1 MiB +   1.1 MiB =   7.2 MiB	tracker-miner-fs
  6.4 MiB + 971.0 KiB =   7.4 MiB	zeitgeist-fts
  5.7 MiB +   2.1 MiB =   7.8 MiB	nm-applet
  8.4 MiB +  39.5 KiB =   8.4 MiB	dhclient
  5.7 MiB +   4.5 MiB =  10.2 MiB	goa-daemon
  9.3 MiB +   2.0 MiB =  11.3 MiB	gnome-terminal-server
 11.8 MiB + 556.0 KiB =  12.4 MiB	tracker-store
 10.6 MiB +   2.3 MiB =  12.9 MiB	applet.py
 11.8 MiB +   2.9 MiB =  14.7 MiB	gnome-settings-daemon
 11.3 MiB +   7.3 MiB =  18.6 MiB	evolution-alarm-notify
 18.4 MiB +   7.7 MiB =  26.1 MiB	Xorg
 20.6 MiB +   8.0 MiB =  28.6 MiB	keepassx
 29.5 MiB +   3.2 MiB =  32.7 MiB	transmission-gtk
 37.7 MiB +   3.1 MiB =  40.9 MiB	evolution-calendar-factory
 59.0 MiB +   4.1 MiB =  63.1 MiB	nautilus
 60.9 MiB +   4.0 MiB =  64.9 MiB	tracker-extract
242.8 MiB +   6.6 MiB = 249.4 MiB	gnome-shell
398.7 MiB +   7.5 MiB = 406.2 MiB	firefox-esr
---------------------------------
                          1.1 GiB
=================================

Code: Select all

russel@debian-nuc:~$ lsblk /dev/sdb2
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb2   8:18   0  9.3G  0 part [SWAP]

Code: Select all

russel@debian-nuc:~$ du -h /dev/sdb2
0	/dev/sdb2
Assuming no need to use suspend or hibernate what swap size would you recommend with a 120GB SSD and 8GB ram?

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Optimize installation on new SSD

#11 Post by pylkko »

I may be wrong, but since hibernation and hybrid sleep write the contents of the RAM in use as an image in swap, then you really might not ever need 8 GB of swap for hibernation with a machine of 8 GB of RAM, given that the entire memory is hardly going to be in use... Unless you are running several virtual machines or something, in which case you might just as well suspend or shut them down before you hibernate.

User avatar
alan stone
Posts: 269
Joined: 2011-10-22 14:08
Location: In my body.

Re: Optimize installation on new SSD

#12 Post by alan stone »

bw123 wrote:There are a lot of threads about ssd, but I don't think the forum search will find three letters, maybe try search for "solid state" instead.
https://lmgtfy.com/?q=site%3Ahttp%3A%2F ... an.net+ssd

newtimes333
Posts: 5
Joined: 2016-11-25 18:57

Re: Optimize installation on new SSD

#13 Post by newtimes333 »

I never use hibernation. I think it is is disabled by default and I haven't put in on.

My computer is far from snappy. I think it has more to do with the old hardware and Gnome DE though.. I hope that a SSD will help out a bit.

Never use more than one virtual machine at the time but often have a lot of tabs in Chrome and listen to Spotify in the backgrund.

I've read some threads already but haven't found consensus on how to optimize a SSD.

ruffwoof
Posts: 298
Joined: 2016-08-20 21:00

Re: Optimize installation on new SSD

#14 Post by ruffwoof »

I run a 2GB ram with no swap (Debian Jessie stable) as a desktop system without any problems. Moderate use office documents/(large) spreadsheets, and typical web browsing.

All contained in a single partition (no separation of /home for instance). That same partition is also the 'persistence' partition for a live-boot choice that I mostly run i.e. the full install is also the 'save' partition. I like to boot the exact same instance each and every time which live-boot using a HDD installed base provides, all changes lost at shutdown (I store documents to disk directly). i.e. I only boot full install (read/write) to apply updates before rebooting live-boot style again. Live-boot stores all changes in memory, which runs faster than if they're being written/read from disk. Also helps to keep the system factory-fresh/pristine. The downside is that changes are lost, browser history/bookmarks etc. I however have a limited few (20 or so) that I've set to be preserved (via the full read/write boot session). For the likes of Osmo (diary/calendar), I've just sym-linked that to the 'save' area so changes are preserved across reboots.

If you've 8GB of ram then depending upon your usage there's potentially more than enough space without needing a swap partition. Yes maybe if you're running more of a server or virtual machines etc. but even then you can create and activate a swap file instead of using a allocated swap partition. Or maybe even just install/use zram.

For instance to create and activate a 1GB swap file :

dd if=/dev/zero of=/root/myswapfile bs=1M count=1024
chmod 600 /root/myswapfile
mkswap /root/myswapfile
swapon /root/myswapfile

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Optimize installation on new SSD

#15 Post by Head_on_a_Stick »

ruffwoof wrote:For instance to create and activate a 1GB swap file :

Code: Select all

dd if=/dev/zero of=/root/myswapfile bs=1M count=1024
You may find this method to be quicker:

Code: Select all

# fallocate -l 1G /root/myswapfile
That command is in the util-linux package ;)
deadbang

dibl
Posts: 528
Joined: 2009-10-13 19:50
Location: Dayton, Ohio, USA

Re: Optimize installation on new SSD

#16 Post by dibl »

newtimes333 wrote:
How would you optimize this disk for Debian? I will only use it on this compute so no dual boot and so on.
It is a couple of years old, but still mostly accurate.

https://news.siduction.org/2014/10/revi ... ith-linux/
Debian sid / siduction KDE

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Optimize installation on new SSD

#17 Post by sunrat »

These days one doesn't need to be too pedantic with SSD optimization, they are amazingly durable. One test committed mass murder on 6 SSDs and they all wrote hundreds of terabytes before failing, and 2 lasted past 2PB!
http://techreport.com/review/27909/the- ... e-all-dead

That said, I still haven't done any tweaks with my 3 month old Samsung 850 500GB. Must get around to it, but the only ones I plan to do are fstrim/cron and commit as mentioned in the siduction article linked above.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

newtimes333
Posts: 5
Joined: 2016-11-25 18:57

Re: Optimize installation on new SSD

#18 Post by newtimes333 »

Ok I messed up my laptop keyboard during upgrade (zif connector).... :oops: :evil:

I can't use the built in keyboard or the external usb keyboard to do bios settings.

Is it a problem if I don't use AHCI? I know that I will lose speed, but could it harm the SSD? I will have to save for a new computer...

Installed Sparky Linux with 2 partitions.

Start End Size
/dev/sda1 2048 411647 200MB vfat
/dev/sda2 411648 234440703 111,6G ext4

The computer is a lot faster though.

Post Reply