Answer the question
In order to leave comments, you need to log in
How to allocate memory on ubuntu 16.04?
I asked those. support to increase the memory on the vps disk, they increased it, they told me to allocate memory, but I have no idea how to do it, I went to Google and didn’t find anything, I wrote a bunch of code in putty and I’m afraid I broke something. Can someone tell me how to mark this memory? Maybe there is some instructions. Thank you.
Answer the question
In order to leave comments, you need to log in
if you need to expand a partition on a disk, then it ’s usually done like this:
first you need to find out which disk and which partition on it you need to expand
which disk you can look at with the command
; lsblk
, let’s say it will be the / dev / sda disk according to the space
occupied
by the partitions, you can look
free
or just use cfdisk which will show everything is in pseudo-graphic mode,
let it be the second partition ( /dev/sda2 ) on the disk that needs to be extended to the end of the disk
if the /dev/sda2 partition is mounted, then it needs to be unmounted:
then there are two steps
1) change the partition table ( TP
; sfdisk -l /dev/sda
; sfdisk -F /dev/sda
; cfdisk /dev/sda
; umount /dev/sda2
) the disk by specifying the desired size for the partitions
2) change the size of the file system ( FS ) for this partition
1. just in case, save the TR
dump so that in which case you can restore it
later if you need to restore it by the
way --dump generates a simple human-readable format
now in TR we specify new boundaries for the /dev/sda2 partition
where -N 2 is the second partition, ", +" == "beginning, size" of the partition, and +
; sfdisk --dump /dev/sda > sda.dump
; sudo sfdisk /dev/sda < sda.dump
; echo ", +" | sudo sfdisk -N 2 /dev/sda
this is an abbreviation indicating the size that needs to be set by default, this is the maximum possible size, that is, if after the second partition there is an empty space up to the end of the disk, then sfdisk will stretch the partition to the end of the disk, or to the beginning of the next partition if it is there.
check the TR for
possible errors instead of the above manipulations with sfdisk ,
you
; sfdisk -V /dev/sda
can use the same cfdisk pseudographic utility , it is quite easy to figure out how to change the TR (see [Resize]) FS everything is in order,
then comes the extension itself
; e2fsck -f /dev/sda2
; sudo resize2fs /dev/sda2
this command expands the FS of the /dev/sda2 partition to the boundaries specified in the TR
and finally, let's check again
; e2fsck -f /dev/sda2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question