You are not logged in.

#1 2017-03-03 16:17:40

linux_user
50/50 it's a spam account
Registered: 2016-11-04
Posts: 484

[SOLVED] Join/Merge two partitions

Is it possible to join the root partition (mount point /) with another partition. I am running out of space in my root partition.

Last edited by linux_user (2017-03-06 16:26:18)


"Blind faith to authority is the greatest enemy of truth."

Offline

#2 2017-03-03 16:58:36

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] Join/Merge two partitions

linux_user wrote:

Is it possible to join the root partition (mount point /) with another partition. I am running out of space in my root partition.

Why are you running out of space? Log files, /var package cache, wastebasket?


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#3 2017-03-03 16:58:53

linux_user
50/50 it's a spam account
Registered: 2016-11-04
Posts: 484

Re: [SOLVED] Join/Merge two partitions

earlybird wrote:

a) You can't merge two different file systems. zfs and btrfs might have features that can realise something similar though.

It's the same file system. Ext4.

earlybird wrote:

b) If you are using LVM (post lsblk output), you can shrink any other partition and grow your root partition; or you can plug in another hard drive and extend the partition over it.

toor@linux:~$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0      2:0    1    4K  0 disk 
sda      8:0    0 74.5G  0 disk 
├─sda1   8:1    0    2G  0 part [SWAP]
├─sda2   8:2    0 62.8G  0 part /media/disk
└─sda3   8:3    0  9.8G  0 part /
sr0     11:0    1 1024M  0 rom  
toor@linux:~$ 

I don't think I am using LVM. Am I?

earlybird wrote:

c) If you are not using LVM, you have to work with hard disk geometry and need to shrink file systems, partitions, move partitions, then extend your root partition, then grow the file system.

Gparted lists sda2, sda 1 and then sda 3. There is a swap partition in between. Do you think I can resize/merge the sda2 and sda3?

earlybird wrote:

d) You could use a CoW file system on /usr or so to "merge" two file systems, BUT overlayfs and aufs are unstable pieces of crap, so please don't.

Will try this only if there is no other way.

earlybird wrote:

e) Did you clean up unneeded data as far as possible already?

I only have an 80GB HDD.. How much will I clean up? big_smile:D I have cleaned as much as I could.

Last edited by linux_user (2017-03-03 17:05:36)


"Blind faith to authority is the greatest enemy of truth."

Offline

#4 2017-03-05 16:39:59

linux_user
50/50 it's a spam account
Registered: 2016-11-04
Posts: 484

Re: [SOLVED] Join/Merge two partitions

damo wrote:
linux_user wrote:

Is it possible to join the root partition (mount point /) with another partition. I am running out of space in my root partition.

Why are you running out of space? Log files, /var package cache, wastebasket?

Because I have been installing some new apps recently, viz.. gimp, play on linux etc... My root folder is just 9.5 GB. I have cleaned as much as I could. How do I know if I am using LVM?

Last edited by linux_user (2017-03-05 16:42:46)


"Blind faith to authority is the greatest enemy of truth."

Offline

#5 2017-03-05 17:13:10

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] Join/Merge two partitions

linux_user wrote:

... How do I know if I am using LVM?

Did it appear in the output of lsblk?

Last edited by damo (2017-03-05 17:50:51)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#6 2017-03-05 17:54:54

linux_user
50/50 it's a spam account
Registered: 2016-11-04
Posts: 484

Re: [SOLVED] Join/Merge two partitions

damo wrote:
linux_user wrote:

... How do I know if I am using LVM?

Did it appear in the output of lsblk?

Nope it didn't...

toor@linux:~$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0      2:0    1    4K  0 disk 
sda      8:0    0 74.5G  0 disk 
├─sda1   8:1    0    2G  0 part [SWAP]
├─sda2   8:2    0 62.8G  0 part /media/disk
└─sda3   8:3    0  9.8G  0 part /
sr0     11:0    1 1024M  0 rom  
toor@linux:~$ 

So I guess I a not using. Is there any way that I can enable it now without reformating the disks?


"Blind faith to authority is the greatest enemy of truth."

Offline

#7 2017-03-05 18:35:37

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] Join/Merge two partitions

linux_user wrote:

... Is there any way that I can enable it now without reformating the disks?

"Menu -> Help & Resources -> Debian -> Wiki" and search for LVM. Please make some attempt at looking for answers before asking others to do it for you.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#8 2017-03-05 20:42:50

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,169
Website

Re: [SOLVED] Join/Merge two partitions

What's the /media/disk partition that uses all your space?

I've always put everything under / but I don't keep sensitive data on my system and I don't care if I have to reinstall the entire system if something messes up.

BL provides gparted to resize or otherwise change partitions, but you risk trashing the OS when you resize. I've had it work and I've had it fail.

Links to various partition scheme recommendations...

https://www.debian.org/releases/stable/ … 03.html.en
http://www.tldp.org/HOWTO/Multi-Disk-HOWTO.html

https://help.ubuntu.com/community/PartitioningSchemes

https://wiki.archlinux.org/index.php/partitioning

https://access.redhat.com/documentation … d-x86.html

If English isn't your first language, let us know.


I don't care what you do at home. Would you care to explain?

Offline

#9 2017-03-06 07:30:56

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [SOLVED] Join/Merge two partitions

I would backup the system and then use gparted to shrink /dev/sda2 and then enlarge /dev/sda3

The two partitions are contiguous and use a very robust filesystem so it should be fine wink

Offline

#10 2017-03-06 09:00:00

linux_user
50/50 it's a spam account
Registered: 2016-11-04
Posts: 484

Re: [SOLVED] Join/Merge two partitions

hhh wrote:

What's the /media/disk partition that uses all your space?

That's the partition where I store media files (music, movies etc...).

hhh wrote:

I've always put everything under / but I don't keep sensitive data on my system and I don't care if I have to reinstall the entire system if something messes up.

My data is backed up too, but I do not want to go through reinstallation. There are some torrents in queue, most apps configured to my preferences etc... I would reinstall only if there is no other way.

Head_on_a_Stick wrote:

I would backup the system and then use gparted to shrink /dev/sda2 and then enlarge /dev/sda3
The two partitions are contiguous and use a very robust filesystem so it should be fine

The problem is that gparted doesn't display the two partitions as contagious - sda2 is first, then sda1 and finally sda3. Screenshot here. I cannot shrink sda2. Screenshot here. The arrow buttons are disabled and typing a lower size and <tab> resets the field to the original number.

By the way, I am looking to join/merge two ext4 partitions, not resize. Will resort to resizing or reinstallation only if merging isn't possible or fails.

hhh wrote:

"Menu -> Help & Resources -> Debian -> Wiki" and search for LVM. Please make some attempt at looking for answers before asking others to do it for you.

I had read that page after earlybird's post. There is this command to merge, vgmerge.

But the first para itself says that, "Storage volumes created under the control of the logical volume manager can be resized and moved around almost at will." Now that my storage volumes were already created without LVM, I am not sure if installing LVM to the system now will enable LVM functionalities on my partitions; or in other words, will make my partitions as if it were 'created under the control of logical volume manager'. Hence my question,

linux_user wrote:

Is there any way that I can enable it now without reformating the disks?

May be that question didn't come out right. Sorry about that.

I will go through them and see what can be done about this. Thanks everyone.

Last edited by linux_user (2017-03-06 09:10:14)


"Blind faith to authority is the greatest enemy of truth."

Offline

#11 2017-03-06 13:29:07

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,169
Website

Re: [SOLVED] Join/Merge two partitions

linux_user wrote:

By the way, I am looking to join/merge two ext4 partitions, not resize.

You want to merge your media and root partitions? You can't. You can backup your media files, delete or shrink that partition and expand the root one.


I don't care what you do at home. Would you care to explain?

Offline

#12 2017-03-06 16:25:49

linux_user
50/50 it's a spam account
Registered: 2016-11-04
Posts: 484

Re: [SOLVED] Join/Merge two partitions

hhh wrote:
linux_user wrote:

By the way, I am looking to join/merge two ext4 partitions, not resize.

You want to merge your media and root partitions? You can't. You can backup your media files, delete or shrink that partition and expand the root one.

Hmm... Thank you smile


"Blind faith to authority is the greatest enemy of truth."

Offline

#13 2017-03-06 18:42:54

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: [SOLVED] Join/Merge two partitions

@linux_user There seem to be gparted screenshots missing in your post above. Those numbers - sda1, sda2... - might be misleading sometimes as they do not refer to the physical order of the partitions on the hdd. It's possible that sda5 is actually the first partition, and after that comes e.g. sda3.
If I understand it correctly, your root partition is at the end - and the /home(data) is at the beginning. In between there is the swap partition. Somebody correct me if I'm wrong, but in this situation I'd try the following: Shrink the data partition and move swap next to it. After that move root after the swap partition, so there will be free space to finally resize it. Just my 0.02$.

Offline

#14 2017-03-06 19:36:36

linux_user
50/50 it's a spam account
Registered: 2016-11-04
Posts: 484

Re: [SOLVED] Join/Merge two partitions

martix wrote:

@linux_user There seem to be gparted screenshots missing in your post above.

You can right click on that link and select View/open image on new tab. You'll see the images.

martix wrote:

If I understand it correctly, your root partition is at the end - and the /home(data) is at the beginning. In between there is the swap partition. Somebody correct me if I'm wrong,

You're right!

martix wrote:

ut in this situation I'd try the following: Shrink the data partition and move swap next to it. After that move root after the swap partition, so there will be free space to finally resize it. Just my 0.02$.

I tried it.. Open the second screenshot from my previous post. It's pretty much the same with the other partition too.

So now i'll have to delete them and resize or reinstall OS.


"Blind faith to authority is the greatest enemy of truth."

Offline

#15 2017-03-07 23:16:04

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: [SOLVED] Join/Merge two partitions

Well, I would not rely on gparted - it gave me headaches in the past too often. Once I was in a similar situation (tried to move a partition, but gparted refused to do it). I was close to delete everything but in the end I also tried a windows tool (minitool partition wizard) - and it did the job (hdd has been working fine ever since).

Those picture links look a bit strange for me, only "Screenshot here." two times, after right click no option to open it in a new tab (only view image). Anyway, if that sda2 partition is not completely full, there should be a way to shrink it. If you start a live system from USB and fire up gparted, basically it should be able to do it. If it does not work, you can still try terminal tools like resize2fs.

Offline

#16 2017-03-08 07:05:41

linux_user
50/50 it's a spam account
Registered: 2016-11-04
Posts: 484

Re: [SOLVED] Join/Merge two partitions

martix wrote:

Well, I would not rely on gparted - it gave me headaches in the past too often. Once I was in a similar situation (tried to move a partition, but gparted refused to do it). I was close to delete everything but in the end I also tried a windows tool (minitool partition wizard) - and it did the job (hdd has been working fine ever since)..

How did you run the minitool partition wizard? In windows or using wine?

martix wrote:

Those picture links look a bit strange for me, only "Screenshot here." two times, after right click no option to open it in a new tab (only view image).

Are you able to view image then?


"Blind faith to authority is the greatest enemy of truth."

Offline

#17 2017-03-08 09:59:08

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: [SOLVED] Join/Merge two partitions

^Yes, it is possible to view the images, only the way how it is embedded looks weird (not like a link, but plain text).

The partition wizard was on a dual-boot machine, so I could run it from windows. I'm wondering if a linux live system with default wine and installing partition wizard would help. However on your screenshot it looks like there is a 62 GB partition, which you try to shrink, but it has 59 GB data on it! I'm not sure how many GB you try to shrink that partition, but there should be more free space before the process.

As for the partition table, you can see the exact locations and sizes via

sfdisk -d /dev/sda

After understanding the process with resize2fs, this could be the way to complete the first step (for making more space on root in the end).

Offline

Board footer

Powered by FluxBB