LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-22-2022, 04:52 AM   #1
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
Resize home partition without powering off


From the search I have done, most of the answers were to su as root, unmount /home, resize, mount /home and su user.

What will happen to the GUI session when I unmount /home?

I am not familiar with command line resizing and will be using GParted for the resize. Can I start a GUI session as root and how, or just only start GParted if possible as that is the only thing I will be using as root.
 
Old 06-22-2022, 04:55 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
living filesystem cannot be [easily] resized, so you need to umount it first.
if the GUI session uses that /home it will just crash, or umount will be refused.
I would suggest you to boot a live CD (or another OS) to resize that filesystem.
 
2 members found this post helpful.
Old 06-22-2022, 07:21 AM   #3
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
+1 to pan64.
Just unmounting your home directory to resize is problematic at best. Better to boot into rescue or from a live USB and performing your block device changes.
 
Old 06-22-2022, 07:33 AM   #4
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
If you resize a partition while it is in use then you are risking data corruption. You don't know what files are in use or in the process of being written and changing the partitions for a live system can cause it to overwrite other data. In fact even imaging an in use filesystem (using dd) can cause in consistencies in the target.

Why don't you want to boot using a rescue or live CD to do the resize?

Also, I highly recommend that you make a full backup of all data on the drive (not just the partition being resized) before resizing it.
 
Old 06-22-2022, 07:56 AM   #5
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
I went with the bootable USB option, looked easier.
 
Old 06-22-2022, 12:04 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938
LVM = Logical Volume Management can also be useful in situations like this. This subsystem cleanly separates the physical storage picture from the logical view seen by the operating system and its users. A "logical volume" can span multiple physical devices – all of which are made part of the same "storage pool." It is a very flexible and well-thought-out system that is readily available (maybe the default) in most Linux distros. You might be unaware that you even have it ... until you need it. It trivializes the response to what is otherwise a very difficult-to-handle situation: "running out of space somewhere."

In addition, useful commands exist to take care of "the drive that suddenly begins to make ominous clicking noises." You can migrate everything off the potentially-failing drive without downtime. Very nice. Even elegant.

So in this case you wouldn't have to "resize the partition." You'd simply carve out another partition, add it to the storage pool, and let the logical volume continue to expand into it. You can now manage the physical situation and the logical situation independently.

Last edited by sundialsvcs; 06-22-2022 at 12:09 PM.
 
Old 06-22-2022, 12:16 PM   #7
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Resizing a partition implies that you have some unused spare space. If you have enough unused space I would advise that you create a new partition in the spare space, format the new partition, copy /home to the new partition, and then change /etc/fstab to mount /home on the new partition.

At that point you can either reboot or umount /home and then mount it again.

Last edited by jailbait; 06-22-2022 at 12:18 PM.
 
Old 06-22-2022, 01:57 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
Originally Posted by Debian6to11 View Post
I went with the bootable USB option, looked easier.
Sensible choice. It's theoretically possible, but Murphy's Law bides it time for opportunities like that.
 
Old 06-22-2022, 04:00 PM   #9
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
I do not use LVM, I consider my system small for that. I just use GPT disks with partitions formatted with ext4 file systems.

The home partition was big, more than 800 GB and I use less than 200 GB. So I decided to make it smaller and create a dedicated partition for VMs. Since I backup the home partition, I wouldn't want to backup the VMs too, since they are just for looking/checking different distros. It would have been a waste of backup space.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to resize the home partition without reinstallation Nindoksei Linux - Newbie 5 05-02-2009 10:58 AM
monitor powering off dive Slackware 4 04-13-2006 12:05 AM
Powering off when powering off, how hard can it be? Ian_Hawdon Slackware 14 01-19-2006 03:19 PM
Computer powering off after UPS plug removed arobinson74 Linux - Hardware 1 05-22-2005 10:01 PM
Powering off... daihard Linux - Software 1 12-22-2004 04:20 PM

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

All times are GMT -5. The time now is 03:18 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