I
I
Igor2021-02-15 08:20:09
linux
Igor, 2021-02-15 08:20:09

How to add space to a linux disk?

Input :
vmware esxi 6.0
debian 10 stretch The
question is the following, added space to the finished operating system from the hypervisor.
When looking at "lsblk -l"

NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0    2:0    1     4K  0 disk
sda    8:0    0 474,3G  0 disk
sda1   8:1    0   146G  0 part /
sda2   8:2    0     1K  0 part
sda5   8:5    0     4G  0 part [SWAP]
sr0   11:0    1  1024M  0 rom

I see this is not a partitioned place, but when created with cfdisk, fdisk /dev/sda, run with gparted live, the place is not added to sda1
What was done?
Using fdisk, sda1 was removed and tried to be created again, but he sees only his 146 gigs, and he does not see the rest. With the help of gparted live I tried to add a place to / dev / sda1, but he does not see this place that is not marked up.
How should this be done at all? In Google, everything converges to this fdisk, supposedly deleting a partition, then creating the same partition only with more space, but it doesn’t work out for me. Thanks in advance for your replies.
ps (not lvm disks)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2021-02-15
@whitegtr

Because you added a place at the end of the disk, and the / sda1 partition at the beginning of the disk. There are other sections in between.
How to enlarge home partition in Ubuntu via gparted when free space is not nearby?
Move /sda5 to the end.
Then move /sda2 close to /sda5.
After that, free space will be right after /sda1 and you can expand /sda1.
Although why these difficulties, / sda5 you have a swap, it can be easily deleted and re-created.
And about /sda1 you say that you have already deleted it. And what is left there? /sda2 1KB in size - some kind of dummy?
Isn't it easier to do everything from scratch? Unless you are doing it for educational purposes.

V
Vitaly Karasik, 2021-02-15
@vitaly_il1

IMHO, the easier way is to create a new partition, and move large directories from "/" there. It could be "/home", or something else - check
du -kx / | sort -rn |head -20

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question