Debian linux on ssd

Introduction

Using a solid state drive (SSD) can speed up your system by about 200%.
The reason is that a SSD has a reading speed that is higher than a hard disk and it has a average access time of only 0.2ms.

The physical medium used in an SSD can only be written a limited number of times, but modern/decent drives do wear levelling so this is not a concern.

This page describes how to migrate from an hard disk to a SSD. Note that this page describes one way of doing so — there are other ways to do this.

Preparation

To copy your running hard disk installation to the SSD, you must do it when it is unmounted (this means, inaccessible to the user and the operating system).

You will have to download, burn to a CD, DVD or USB drive then boot a «Live» version of some GNU/Linux distribution such as Debian, although any distribution should work, to do the steps described here.

WARNING: be very careful when doing this, and note that the partition and drive names will almost always differ from this page!

Most of the write processes will be done in the /home directory by several applications.
The rest of the permanent write operations will be done by the system in the /var directory.

This example hard disk installation of Debian is on /dev/sda1 — it is mounted now under /media/sda1.
The SSD is on /dev/sdb1 — it is mounted now under /media/sdb1.
This installation’s /srv directory is in a separate partition — it is mounted now under /media/sda7.

One would want to permanently mount the SSD under /ssd in that example hard disk installation. One would add this to their /etc/fstab:

# /dev/sdb1 SSD UUID=5c902625-e63e-446f-a5c5-c24a1176dec7 /ssd ext4 defaults 0 2

One can get the UUID’s with the command blkid as root.

/dev/sdb1: LABEL="SSD" UUID="5c902625-e63e-446f-a5c5-c24a1176dec7" TYPE="ext4"

Now, one would copy the /home and /var directory on the harddisk to the SSD.
One would these 2 directories to the path /srv/ssd.

mkdir /media/sda7/ssd cd /media/sda1 cp -pvr home /media/sda7/ssd/. cp -pvr var /media/sda7/ssd/.

Backup

It is generally a good idea to make a backup of the hard disk partition and use this backup on the SSD disk.

cd /media/sda1 mkdir /media/sda7/Backup tar cvfz /media/sda7/Backup/Backup_Debian_sda1_120907.tgz *

Installation

Unpack the backup now to the SSD:

cd media/sdb1 tar xvf /media/sda7/Backup/Backup_Debian_sda1_120907.tgz

Alternative to the backup you can copy the installation direct to the SSD:

cd /media/sda1 cp -axv . /media/sdb1/.

Now we can delete the /home and /var on the SSD and replace it with links:
(Be careful to be on the right SSD-path!)

cd media/sdb1 rm -rf home ln -s /srv/ssd/home home rm -rf var ln -s /srv/ssd/var var

Configuration

The final configuration is to adapt the config files to the SSD drive.

Читайте также:  Удаленное управление линукс минт

One must edit the /media/sdb1/etc/fstab and alter the mountpoint of the root path:

UUID=5c902625-e63e-446f-a5c5-c24a1176dec7 / ext4 errors=remount-ro 0 1

This was the main stuff for the migration.

Now you must look to boot from your SSD drive.
It is possible to boot grub from your harddisk or from the SSD.

Now you should boot your normal Debian installation again.
Run grub-update as root to get the SSD in your boot list.

At this time there is a bug in the grub-generator, so you should fix the wrong UUID.
I opened a bug for it with a description of the error: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686754

It is a good idea to update the initrd.img as root now.

With the correct /boot/grub/grub.cfg you can boot from your harddisk the SSD now.

When you want to boot from the SSD, you can alter it with this steps in the running harddisk installation:

Copy the /boot/grub/grub.cfg to the SSD as root:

cp /boot/grub/grub.cfg /ssd/boot/grub/grub.cfg

Now you must install the grub on the SSD via chroot:

mount --bind /dev /ssd/dev mount --bind /proc /ssd/proc chroot /ssd grub-install /dev/sdb

Normally you have to change the settings in your BIOS to boot from the SSD.
You should be able to boot the SSD now.
After you have booted, don’t forget to update the initrd.img on the SSD either.

Benchmarks

You can get an idea of the performance increase trying these benchmarks:

root@PC# echo 3 > /proc/sys/vm/drop_caches root@PC# hdparm -Tt /dev/sda /dev/sda: Timing cached reads: 7216 MB in 2.00 seconds = 3609.64 MB/sec Timing buffered disk reads: 292 MB in 3.01 seconds = 96.91 MB/sec root@PC# hdparm -Tt /dev/sdb /dev/sdb: Timing cached reads: 7138 MB in 2.00 seconds = 3570.42 MB/sec Timing buffered disk reads: 464 MB in 3.00 seconds = 154.51 MB/sec

The reads from the disks may not reflect the reality, because you read from the cache of the disks.

You should have a close look to the read-speeds of the SSD disks, because the speed is dependent on the disk size.

8GB | 16GB | 32GB | 64GB | 128GB | 256GB 128MB/S | 117MB/S | 145MB/S | 153MB/S | 158MB/S | 160MB/S

This was measaured using Debian Wheezy with KDE.
First the time booting from hitting Enter in GRUB up to the point the Login appear.
Then the time hitting Enter for the password up to the last sound starting KDE.

Boot Start OS Total Condition 26.2 30.2 56,4 Booting from harddisk 26.7 33.3 60 Booting from harddisk with symbolic links for /home and /var 15.1 16,9 32 Booting from SSD

See also

Author of this page: Karsten

Источник

How To Partition Debian 10 With SSD Storage

How to Partition Debian 10 with SSD Storage

The solid-state drive uses flash memory to deliver vastly superior performance and durability. SSDs are faster and more durable than HHDs and do not have any moving parts like them. Supporting reading and writing data, its capacity is much larger and people prefer to use it. Internal SSDs connect to a computer like a hard disk. In this article, you will learn How to Partition Debian 10 with SSD Storage. People believe that time is not buyable, but you can do this with SSD. So, visit Eldernode to purchase SSD VPS and enjoy the speed of progress and innovation.

Читайте также:  Linux set file modification time

Tutorial Partition Debian 10 with SSD Storage

Disk partitioning (Partition Debian 10 With SSD)

If you wish to install a server properly, you need to partitioning. When you create one or more storage regions and manage each one separately, it is called disk partitioning. You may do this before creating any file system and while you are preparing a newly installed disk. The information of partitions’ locations and sizes in an area known as partition table is stored in the disk. The information will be read by the Operating System before any other part of the disk. Debian developers have considered several varieties of partitioning programs to work on various types of hard disk and computer architectures such as partman, fdisk, and cfdisk.

If you have multi-user systems or systems with lots of disk space, you are recommended to put /var,/tmp, and /home each on their own partitions separate from the / partition. You will need a separate /user/local partition if you wish to install many programs that are not part of Debian distributions. Make /var/mail as a separate partition if your machine will be a mail server. If you are setting up a server with lots of user accounts, having a separate and large /home partition is suggested.

Partitioning Debian 10 with SSD

When you start to install your Debian Server and pass the required steps, you will reach the step of partitioning. It is not at all an optional step and is indispensable in the installation process. also, you will choose the filesystem to be used. It helps you to control data security and the administration of the server.

Partitioning tool

If you are a new user, traditional partitioning would be difficult for you since you must define the various partitions of the disk on which the Linux filesystem and virtual memory (swap) will be stored. Also, if you have another Operating System and you wish to keep it. In this way, you need to make sure that you do not alter its partitions and resize them until they would not damage your machine.

Note: You can use the mode of ”guided” that partition software will provide. The suggestions of this software are close to what you wish to do. Here you must choose your partition mode.

Installer guide

If you are using Linux solely, you are recommended to choose the option ”Guided – use entire disk” to start guided partitioning. But if Linux works alongside other already existing partitions, manual partitioning should be chosen. The guided partition can also set up LVM logical volumes instead of partitions.

Guided partitioning (Partition Debian With SSD)

Three partitioning methods are provided by the guided partitioning including ”All files in one partition”, ”Separated /home partition”, and ”Separate /home, var, and /tmp partitions”.

Guided partitioning

All files in one partition
This simple and robust partitioning is perfect for personal or single-user systems. Using this method will create two partitions: the first will house the complete system, and the second the virtual memory (swap).

Читайте также:  Linux mount write access

Separated /home partition
This method splits the file in two: one partition contains the Linux system (/), and the second contains ”home directories”

Separate /home, var, and /tmp partitions

The third method is better to be chosen for the servers and multi-user systems. It decides the file tree into many partitions. The divisions have several advantages since users will not be able to lock up the server by consuming all available hard drive space and can not clog up the rest of the system.

Validating partitioning

When you choose the type of partition, the software will calculate a suggestion and describe it on the screen. You will also be able to modify it if you wish and choose another filesystem if the standard choice is not appropriate. However, you will face a reasonable partitioning which helps you to accept it and select the ”Finish partitioning and write changes to disk” entry.

Validating partitioning

Manual partitioning

In the section of choosing the partition mode, you saw the option of ”manual” which is possible to be chosen like others. When you decide to partition manually, you will have some advantages such as smooth backup, restore process, ability to maintain especially allocated partitions for the different section for storages, and so on. If you select manual partitioning, it would go on more flexible and it is up to you to size the partitions.

The available disks, their partitions, and any possible free space (that has not yet been partitioned) are displayed on the first screen. So, you can select each one of them or erase all partitions on a disk by selecting it.

To create a new partition manually, select free space on a disk. The guided partition also can do this for you.

But what you must do when choosing a partition?

Try to indicate the manner in which you will use it. The list below helps you how to consider them. However, you can choose to not use it and leave it unchanged.

1- Format it and include it in the file tree by choosing a mount point.

2- Use it as a swap partition.

3- make it into a ”physical volume for encryption”.
4- Use it as a RAID device.
Finally, you can review the partitions. At the bottom of the list, choose ”Finish partitioning and write changes to disk”.

Conclusion

In this article, you learned How To Partition Debian 10 With SSD Storage. You will speed up your system by about 200% when you start using an SSD. In case you are interested in learning more, find our related article on What is SSD Hard and how does it work.

Click on a star to rate it!

Average rating 4 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

Источник

Оцените статью
Adblock
detector