LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2020, 12:30 PM   #1
bk4linux
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Rep: Reputation: Disabled
Post Extending root Partition


Hi all;
Newbie here, but able to find my way around Linux system.
OS is CentOS7.
How do I extend the system root (/) partition? / has 100%,
First of all, what can I safely delete to relief pressure on the system before going for the disk expansion?
Many thanks
 
Old 03-04-2020, 12:36 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
first thing is to remove all files in /tmp

then remove old log files in " /var/log/"

that should free up some space
 
1 members found this post helpful.
Old 03-04-2020, 12:50 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
You can move the end of the last partition on a drive.

So if you were to have on /dev/sda
Code:
/dev/sda1    /   1GB
/dev/sda2    /home   20GB
free space  100GB
You could move the end of sda2 into the free space, then extend the file system on sda2 to fill the new partition size.

If you wanted to enlarge /dev/sda1

You'll have to delete /dev/sda2

Move the end of /dev/sda1 where you want it, extend the file system on it

Then remake /dev/sda2, format it, put your stuff back on it.
 
Old 03-04-2020, 01:30 PM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,989

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
It depends on the filesystems involved and the partition layout neither of which you have provided.
 
Old 03-04-2020, 02:13 PM   #5
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
You may want to look at bootable Linux with a graphical partition manager to do this with like https://gparted.org/livecd.php
As with any file system, backup everything and assume you will mess up. If you do mess up, try to learn what you did wrong. It's the best way to learn.

It should be possible to shrink a partition to make free space if none is available, then expand / provided the free space is next to it.
 
Old 03-04-2020, 03:12 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Welcome to LinuxQuestions.

By default CentOS 7 uses LVM and xfs filesystems. As kilgoretrout posted it depends on how your system was configured with one caveat that xfs filesystems can only be enlarged not reduced.
 
Old 03-04-2020, 04:02 PM   #7
bk4linux
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
I rebooted the server due to other factors and now I can not log in again. I'm getting this error... "authentication service cannot retrieve authentication info"
 
Old 03-04-2020, 04:47 PM   #8
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Sorry wrong thread
 
Old 03-04-2020, 05:31 PM   #9
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
Can you reboot into recovery mode from the grub menu, or single user mode?
You first posted that / was at 100%, so if it is still like that, then it seems there no space to login. Recover mode should not start some services, so might leave some space on / to run some commands.
 
Old 03-04-2020, 08:52 PM   #10
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
You might try booting with a live disk (your installation disk?) and then mounting your partition somewhere. Even if it is really full you should be able to mount it. Then do as others have suggested on removing files. Also do a search for any .Trash or variations directories and lost+found although you probably won't find the latter unless you normally have external mounts. Files in either are safe to delete. Note you need to actually remove them (rm xxxxx) not send to trash through file manager. Then look at the drive with fdisk or parted or the equivalent and see if the partition can be enlarged considering michaelk's post.
 
Old 03-05-2020, 10:15 AM   #11
bk4linux
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
I have booted the system with CentOS ISO image and can access the /root on /mnt/sysimage. I was able to remove bunch of files from /tmp and /var/logs/.
However, I wanted to create a user account with root level permission to help me gain access into the system to troubleshoot the new error …"authentication service cannot retrieve authentication info"
The background info is that, I inherited this from another sysadmin that left. All I have is a single AD domain based account. No info on the local admin or root account.
So now that I have the opportunity to bring the system to a single user mode, I will like to have a normal local admin account to help in future troubleshooting.

I have tried useradd myadm ; passwd myadm xxxxx but it doesn't seem to be working.
Any idea how to create a root level account in single user mode?

Thanks in advance.

Last edited by bk4linux; 03-05-2020 at 10:17 AM.
 
Old 03-05-2020, 12:34 PM   #12
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Quote:
All I have is a single AD domain based account. No info on the local admin or root account.
If you are going to be admin then you need that.
https://www.liberiangeek.net/2014/09...tos-7-servers/

https://wiki.centos.org/Documentation
https://wiki.centos.org/FAQ/CentOS7
https://wiki.centos.org/HowTos
 
Old 03-05-2020, 12:46 PM   #13
bk4linux
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bk4linux View Post
I have booted the system with CentOS ISO image and can access the /root on /mnt/sysimage. I was able to remove bunch of files from /tmp and /var/logs/.
However, I wanted to create a user account with root level permission to help me gain access into the system to troubleshoot the new error …"authentication service cannot retrieve authentication info"
The background info is that, I inherited this from another sysadmin that left. All I have is a single AD domain based account. No info on the local admin or root account.
So now that I have the opportunity to bring the system to a single user mode, I will like to have a normal local admin account to help in future troubleshooting.

I have tried useradd myadm ; passwd myadm xxxxx but it doesn't seem to be working.
Any idea how to create a root level account in single user mode?

Thanks in advance.
I've fixed this by booting into Linux Rescue, mount root fs to /mnt/sysimage, chroot /mnt/sysimage, change root psw passwd root. Type exit before rebooting. Then finally was able to login locally with the root account and new password.


Now back to my original issue of "How to extend /root partition" that is at 100%. I'm running lvm. Please I still need help on this. Thanks all
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extending root partition on Fedora 26 hobz Fedora 6 05-01-2019 07:24 AM
extending volume group vs extending physical volume which is better ? Gil@LQ Linux - Server 2 08-19-2013 10:13 AM
Extending Red Hat Linux Partition (/root, /swap & /d01) without restarting (Urgent) umairnazim Red Hat 4 06-16-2011 03:00 PM
extending existing windows-partition and changing os on linux partition ungua General 8 05-05-2009 11:01 AM
Extending root partition sumit dash Linux - Hardware 1 12-05-2008 05:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:05 PM.

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