LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-18-2024, 07:08 PM   #1
Mo_
Member
 
Registered: Aug 2022
Posts: 50

Rep: Reputation: 0
How Increase / or /usr Partition using command line from Kali Linux


Hi Community, I recently installed Kali Linux on the KVM virtual machine. Last night, I tried to patch it and got some errors. I found out that the portion is 100% used. I added an additional 20G hard disk vdb. But it doesn't have a Volume group or Logical Volume. When I typed vgs or lvs, it asked me to install packages, and packages are not getting installed since it doesn't have space. I tried to use GUI, but GParted isn't open. I get an error. 90% of space is used by /usr. How can we add an additional 20G to / or /usr? Is there any easier way other than mounting a disk to /mnt and copying data from /usr to /mnt, then deleting data from /usr and mounting another disk to /usr and recopying back to /usr? I am checking if there is an easier way; I have never used Debian before. Not sure debain's volume group and logical volume are different. I would appreciate it if someone could help me figure this out. Thanks
 
Old 04-19-2024, 12:20 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,894

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
if you have just installed it, install it again. Or forget it.
https://www.linuxquestions.org/quest...rs-4175633618/
https://www.linuxquestions.org/quest...ad-4175614092/
 
Old 04-19-2024, 01:28 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Playing with kali as a VM guest might be a great way to learn. This is a generic question, not a "kali question" as such. But you won't get anywhere without giving us some info. Start with this.
Code:
df -hT
lsblk -f -o +SIZE
 
Old 04-19-2024, 10:08 AM   #4
Mo_
Member
 
Registered: Aug 2022
Posts: 50

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
Playing with kali as a VM guest might be a great way to learn. This is a generic question, not a "kali question" as such. But you won't get anywhere without giving us some info. Start with this.
Code:
df -hT
lsblk -f -o +SIZE
Here is the output of those two commands. Thank you,
Code:
┌──(root㉿kali)-[~]
└─# df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  1.9G     0  1.9G   0% /dev
tmpfs          tmpfs     396M  1.1M  395M   1% /run
/dev/vda1      ext4       13G   13G     0 100% /
tmpfs          tmpfs     2.0G     0  2.0G   0% /dev/shm
tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
/dev/vda8      ext4      7.5G  3.2M  7.1G   1% /home
/dev/vda5      ext4      3.2G  892M  2.2G  29% /var
/dev/vda7      ext4      346M   19K  323M   1% /tmp
tmpfs          tmpfs     396M  116K  396M   1% /run/user/125
tmpfs          tmpfs     396M  112K  396M   1% /run/user/1000

┌──(root㉿kali)-[~]
└─# lsblk -f -o +SIZE
NAME   FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
                                                                                      SIZE
sr0                                                                                     2K
vda                                                                                    25G
|-vda1 ext4   1.0         e715156d-f39e-463a-a7c8-d47379f403e4       0   100% /      12.6G
|-vda2                                                                                  1K
|-vda5 ext4   1.0         b478691b-a965-453e-8495-c6178685bfe6    2.1G    27% /var    3.3G
|-vda6 swap   1           67fbd3df-aa72-4ec9-b0ef-0a33a0d06398                [SWAP]  976M
|-vda7 ext4   1.0         920f3b3a-506b-4115-831a-e41710537234  322.2M     0% /tmp    379M
`-vda8 ext4   1.0         30d62574-1ff5-4afe-99f1-f28947de3563    7.1G     0% /home   7.7G
vdb                                                                                    20G

Last edited by Mo_; 04-20-2024 at 01:21 PM.
 
Old 04-19-2024, 10:16 AM   #5
Mo_
Member
 
Registered: Aug 2022
Posts: 50

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
I can install it again, but that won't be a long-term solution because it can happen again, and reinstallation won't be a good idea. I was looking for a solution. Thanks
 
Old 04-20-2024, 12:24 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
When you post command output use code tags, not quote tag - that way it retains layout and is readable.
Quote:
Originally Posted by Mo_ View Post
... 90% of space is used by /usr. How can we add an additional 20G to / or /usr? Is there any easier way other than mounting a disk to /mnt and copying data from /usr to /mnt ...
No, not with that layout.

That's a pretty poor layout IMHO - was this just pre-generated image you used ?. If you can re-install (as in a full install as per usual), I'd suggest you do so again, and choose to use LVM so can easily add space in future. There is no LVM in use in your current system.
 
Old 04-20-2024, 04:45 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,894

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
first: outside of the VM you can increase the size of the vdisk. Or you can add a second vdisk if you wish (this is what you made).
next: start another OS (or VM), mount the initial vdisk (or both the old and the new one) as an additional storage and you can try to move/resize or reorganize those partitions. Also you can edit the fstab file to adapt those changes. And also you may try to use lvm on the new vdisk.
Finally you can boot the initial VM again. It is a great way to learn, and actually kali is not the best OS to learn it.
I think it is still much better to reinstall the whole OS again as it was already suggested.
Obviously you can find a different way to solve it, there are more possibilities, not only this one.
 
Old 04-20-2024, 01:28 PM   #8
Mo_
Member
 
Registered: Aug 2022
Posts: 50

Original Poster
Rep: Reputation: 0
Thank you, guys; I will do a new install as you suggested. I appreciate your help.
 
Old 04-20-2024, 03:55 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,665
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
If your system uses "LVM = Logical Volume Management," as you imply, the process of adding more space is very well-documented and requires no downtime. Just "Google it."

LVM uses physical volumes to create "storage pools" from which "logical volumes" are then carved. A single volume can occupy space on more than one drive. There are other nice things, too – such as the ability to take a failing drive out-of-service transparently.
 
  


Reply

Tags
debian, disk drive, kali, linux, partition



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to fetch http://http.kali.org/kali/dists/kali/Release.gpg aymeric75 Linux - General 2 07-11-2015 05:10 AM
Error: Cannot find 'ssh-keygen' in '/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin' venu.navat Linux - Software 3 03-08-2012 04:00 AM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
FreeBSD 6.2, no /usr/src/tools and /usr/src/usr.bin, failed to build world. Mr_Shameless *BSD 4 05-16-2008 08:43 AM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration