Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, you're in gparted. Use it.
That swap will cause grief due to it being a logical partition. Simply shrink sdb3 (right-click or use the menu). Expand the extended , move the swap to the right, shrink the extended, expand sdb1.
Personally I'd simply delete the swap and sdb2 and reallocate swap later as a primary in some of the free space. Will mess with your fstab though.
Edit: - I like to "apply" each change separately. Then you know things are proceeding as planned.
What you are asking is, I think, probably impossible to achieve without loss of data. We can see you have more than 50% usage on sdb1 and more than 100 GiB on sdb3, plus an extended partition in the middle.
I would like to point out that on MBR disks you can have only 4 primary partitions OR 3 primaries and 1 extended (which in turn may contain something like 15 logical volumes: which can be used as separate partitions). What you should have done is make all your primary partitions at the beginning of the disk and then place your extended at the end, and it is a good idea to have more space in the extended than in the primary partitions because in the extended you can have many logical partitions.
To be honest, I do not recommend shrinking or moving the sdb1 in your situation. From what I see you have an MBR disk with 2 primary partitions and one extended. So you can have one more primary partition on the disk. So, I suggest you shrink sdb3 and make another primary partition in the free space you'll get there. Unless, you have another disk (internal or external) where you can backup the data of sdb3, then you could delete sdb3 and sdb2, and re-plan your disk properly.
Thank you. sdb3 is already backed up. However if I delete sdb2 won't sdb5 (linux swap) also be deleted? Won't this have adverse effects on the operation of my system?
What you are asking is, I think, probably impossible to achieve without loss of data.
Would you care to expand on this opinion ?.
gparted is a very mature product and very reliable. Especially for Linux filesystems that support online resize like ext4. I use it extensively, although in some situations (like this one) it can be fiddly as I outlined above. This is not a fault of gparted but the structure of the partitions themselves - as you also alluded to.
Would you care to expand on this opinion ?.
gparted is a very mature product and very reliable. Especially for Linux filesystems that support online resize like ext4. I use it extensively, although in some situations (like this one) it can be fiddly as I outlined above. This is not a fault of gparted but the structure of the partitions themselves - as you also alluded to.
Yes, I remark that the extended partition is in the middle there, and sdb3 has data on it. I'm saying it is a big risk because I once tried something like this and it didn't work very well. I understand it is no fault of gparted. Fiddling with partitions is simply a risky business.
Quote:
Originally Posted by pconstantatos
Thank you. sdb3 is already backed up. However if I delete sdb2 won't sdb5 (linux swap) also be deleted? Won't this have adverse effects on the operation of my system?
Since you have sdb3 backed up, then, maybe you can experiment a little bit and if everything goes fine, we will have proof that gparted can do the job very well. As syg00 suggested, apply each step separately so that you know everything is done properly:
- try resizing sdb3 so that it takes a suitable size at the end of the disk.
- increase sdb2 so that you have more space in the extended area.
- then move the swap partition to the end of the extended partition so that you have plenty of space on the left.
- eventually, you can move the left boundary of the extended so that you have some unallocated space on the right of sdb1.
- then resize your sdb1 as you wish.
The best advice was given in the first reply by syg00
Delete the swap, switch to swap file instead. There is very little benefit of a swap partition over a swap file these days
If you have SDB3 backed up then the quickest option is to delete that partion then extend sdb1 into the space created. Then create a new partition
You will have to update FSTAB afterwards
It can be done without backing up your data.
1. Deactivate swap and delete sdb2 (extended) partition.
2. Shrink sdb3 to get free space enough for future DATA partition (at the end of sdb3).
3. Create new partition at freed space.
4. Move your files from sdb3 partition to newly created partition.
5. Delete sdb3. Now you have free space between sdb1 and new partition.
6. Create swap partition at the end of free space.
7. Append the rest of free space to sdb1.
Thats all.
Given the situation, you have to ask yourself why you actually want to increase the size of sdb1. 48GB is, in my experience, *huge* for a root filesystem (i.e. the Linux filesystem and user configuration files, less actual user data).
My advice would be to find out what's using all that space in sdb1 (is it one or more virtual machines for example?) and either transfer them to your Data partition, or split up your Data partition into two, using the new partition for the user data that was previously in sdb1 and mounting that in your fstab.
After reading all of the posts the best two were the last two by Teufel and hydruga.
The Teufel post gives the best instructions on how to actually makes the changes given that sdb3 is mostly empty with only 110 GiB used and 747 GiB free.
The comments by hydruga also make sense as 48GiB is a huge root filesystem and instead of simply enlarging the partition you could look to move some stuff into the data partition or create a new partition by shrinking sdb3.
No one has mentioned that all of these issues would go away if LVM was used.
pconstantatos your username?
This would make user pconstantatos and group users the owners of everything in that directory:
chown pconstantatos:users -R /home/pconstantotos
Last edited by RadicalDreamer; 05-25-2017 at 09:41 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.