LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to merge two partitions as one (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-merge-two-partitions-as-one-898897/)

loveulinux 08-23-2011 02:14 AM

How to merge two partitions as one
 
Hi...everybody
I wanted merge these below two partitions as one, because of less free space in each partition.
/dev/sda5 /data
/dev/sda6 /backup
For this I am thinking to unmount /backup partition & mount the nfs partitions with /backup and mount the /dev/sda6 with /backup_old. Then I will move all of the contents from /backup_old to /backup partition. Next how can I merge /dev/sda6(/backup_old) partition with /dev/sda5(/data) partition. This system is configured with hardware raid with 4 partitons(/, /home, /data /backup). Your kind response would realy be appreciated.

saikee 08-23-2011 02:32 AM

I don't know how the partitioning tools would react to a RAID set up but in a ordinary disk you simply deleted /dev/sda6 and use Gparted to extend sda5 the right hand side border to absorb the unallocated space left by sda6. Since both sda5 and sda6 are logical partitions and sda6 is at the end of the hard disk that will work as none of the two are required for booting.

Back up the data before committing the change.

loveulinux 08-23-2011 03:14 AM

How to merge two partitions as one
 
Can I use gparted without reboot?


Quote:

Originally Posted by saikee (Post 4450859)
I don't know how the partitioning tools would react to a RAID set up but in a ordinary disk you simply deleted /dev/sda6 and use Gparted to extend sda5 the right hand side border to absorb the unallocated space left by sda6. Since both sda5 and sda6 are logical partitions and sda6 is at the end of the hard disk that will work as none of the two are required for booting.

Back up the data before committing the change.


saikee 08-23-2011 01:41 PM

Couldn't tell you.

I would have thought the change of data-only partitions should have no connection with rebooting. Gparted doesn't normally demand a reboot.

frieza 08-23-2011 01:59 PM

Quote:

Originally Posted by loveulinux (Post 4450877)
Can I use gparted without reboot?

you should be able to change data partitions without a reboot, provided they are not mounted (changing mounted partition == bad)

changing the OS partition or swap partition should be done from a live cd however as they can't be effectively unmounted while the system is booted.

just make sure to edit your /etc/fstab when done to reflect the changes to your partition structure otherwise you will run into problems when you DO reboot the system

bigrigdriver 08-23-2011 05:06 PM

I'm not certain how RAID handles it, but without RAID, if you change partitions in the manner described, it's best to reboot to reload the partition structure into the running kernel. Otherwise, when writing files into the new partition, you could get error messages about trying to write files beyond the limit of the old partition (as the kernel sees it). Rebooting informs the kernel of the new partition limits and avoids such error messages.


All times are GMT -5. The time now is 10:15 PM.