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 11-08-2020, 11:32 PM   #1
Cacofonix
LQ Newbie
 
Registered: Sep 2018
Distribution: LinuxMint/Debian
Posts: 6

Rep: Reputation: Disabled
Can I shrink my main partition without losing data?


I'd like to use Gparted to shrink my main partition so that I can split my second partition and install a 3rd Linux OS.
Can I do that or will it corrupt my first partition (almost empty)
 
Old 11-09-2020, 12:57 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
Yes, theoretically you can do that, but obviously it depends on the details. Most probably you need to boot another OS and use a tool like gparted to do that.
It may [at least] depend on the usage, type of that partition.
 
1 members found this post helpful.
Old 11-09-2020, 01:10 AM   #3
Cacofonix
LQ Newbie
 
Registered: Sep 2018
Distribution: LinuxMint/Debian
Posts: 6

Original Poster
Rep: Reputation: Disabled
I was thinking of running the Gparted ISO on its own burned to a USB stick. Would that work out?
Thanks!
 
Old 11-09-2020, 01:15 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
most probably yes. in general.
 
1 members found this post helpful.
Old 11-11-2020, 08:43 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Most installers have the option of using a partition manager to help resize. It may not be easy to use so I agree that a live boot to Gparted AFTER you make a backup of important data is the typical way.

Backups protect you from yourself sometimes. Ask me how I know that.
 
Old 11-11-2020, 08:53 PM   #6
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Gparted should move any data in the area to be shrunk. And Murphy was an optimist.
 
Old 11-17-2020, 06:13 PM   #7
adrian-jaramillo
LQ Newbie
 
Registered: Nov 2020
Location: Spain
Distribution: Debian 11
Posts: 27

Rep: Reputation: 1
You can shrink partitions, but it's generally not recommended.

Basically, when you shrink a partition, you are just changing values in the partition table.
When we shrink, we change the pointer to where a given partition ends in your disk.

What partitioning software do, it's changing that end pointer, and moving the "off-range" bits to the new range of disk that partition has.

The thing is, shrinking it's never a safe technique. Extending, is.
Actually, if you ever need to shrink, that means that you previously planned badly your partitioning scheme.

So going back to your question...

Can you shrink?

Yes, you can. At your own risk.

Please, perform a backup on the partition you are going to shrink before doing anything. Just in case.

I hope this answer was helpful, and above all, easy to understand.

---
Adrián
 
1 members found this post helpful.
Old 11-19-2020, 01:58 AM   #8
juanbot386
LQ Newbie
 
Registered: Nov 2020
Distribution: Fedora, Mint, RedHat, Ubuntu
Posts: 3

Rep: Reputation: Disabled
backup and backup the backup

Hi.
Yes, it is possible* and yes you can use GParted live CD.
BUT it is risky. I've seen experienced users who failed to do it and lost all his information.
Backup and then do a backup of the backup. Do not store the backup in a partition in the SAME disk. If you are backing up in a USB HDD, disconect it while doing working on the shrink. Have a plan to reinstall everything in case you fail to do the shrink, for example if you are currently running Ubuntu 19, then make a live/install CD beforehand. I highly recommend using GParted and not using other built in utilities.
 
Old 11-19-2020, 05:39 PM   #9
masterclassic
Member
 
Registered: Jun 2007
Distribution: Knoppix, antiX
Posts: 252

Rep: Reputation: 73
I second the suggestions by juanbot386 and others concerning the backup. A double backup of important data (on different media) increases safety level. If you have a good backup, it is unlikely that anything bad happens. If you don't take any backup, it seems strangely that it attracts problems.

GParted is the right tool. The GParted Live CD/USB is a very good choice as it contains all needed dependencies and is up to date. Please keep in mind to leave enough free space in the partition to work. Moving the starting sector of the partition can be long. Moving the right end only is much faster.
You can't stop a resizing operation after starting, as doing this can leave the filesystem corrupted. This is something you have to take into account if you want to resize big partitions. Power failure is to avoid during resizing.
These safety instructions are valid for any resizing software, not just for GParted.
 
  


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
Shrink main filesystem partition ZZII Linux - Software 6 01-11-2016 04:56 PM
change partition format without losing data smeezekitty Linux - General 23 10-17-2009 12:31 PM
How to partition my HDD without losing any data? deepumnit Debian 4 03-28-2008 03:05 PM
Re-partition without losing data goodtogo Linux - Software 4 06-22-2007 08:20 AM
How to resize the Mandrake partition without losing all my data? Cezaro Mandriva 2 09-28-2004 09:14 AM

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

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