LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   How To Move Linux Partitions To A Single Partition (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/how-to-move-linux-partitions-to-a-single-partition-4175526548/)

njdevils9 11-26-2014 03:05 AM

How To Move Linux Partitions To A Single Partition
 
Hey everyone I had a question about paritioning with Linux... I am using a Acer Aspire V5-122P-0889 laptop. I currently have it dual-booted with Windows 8.1 and Arch Linux. I am getting tired of logging into Windows 8.1 and running Kali Linux (kind of laggy) through VirtualBox so I was wanting to Triple-boot my machine.. I tried to create a New Volume in Windows Disk Management tool but it says that I have too many partitions on my HDD and can not create another Volume. When I installed Arch I created 3 partitions; one for '/', one for '/home' and the other was my for swap. I was wanting to see if I could move the /home and/or swap partitions to the '/' partition so that I can install Kali on my machine via my USB stick (no CD drive)... My '/' partition is set to /dev/sda3 , /home partition is set to /dev/sda6 , swap partition is set to /dev/sda5 and for some reason I have an extended partition on /dev/sda4 that I am currently not sure what is being stored there. Anyways, I'd appreciate any help I could get as to how I can put my Arch Linux partitions into 1 big partition or maybe even 2 partitions if needed but the least partitions the better so that I can attempt to install Kali on a newly created partition.

EDDY1 11-26-2014 03:09 AM

Post output of
Quote:

fdisk -l

syg00 11-26-2014 03:11 AM

Don't use Windows to create Linux partitions. Leave the space unallocated, and Kali should create whatever partitions it needs during install.
From an Arch terminal enter this (as root/sudo) and post all the output
Code:

parted /dev/sda "print free"

njdevils9 11-26-2014 03:19 AM

1 Attachment(s)
Quote:

Originally Posted by EDDY1 (Post 5275242)
Post output of

***UPDATED***

I didn't know how much of a difference it would make but I removed the 30GB of unallocated space that I created from my C:\ right before this thread was started just in case.. It shouldn't make much of a difference but here is the updated screenshot of how it originally was.

njdevils9 11-26-2014 03:27 AM

1 Attachment(s)
Quote:

Originally Posted by syg00 (Post 5275244)
Don't use Windows to create Linux partitions. Leave the space unallocated, and Kali should create whatever partitions it needs during install.
From an Arch terminal enter this (as root/sudo) and post all the output
Code:

parted /dev/sda "print free"

***UPDATED***

I didn't know how much of a difference it would make but I removed the 30GB of unallocated space that I created from my C:\ right before this thread was started just in case.. It shouldn't make much of a difference but here is the updated screenshot of how it originally was.

Sorry for the hassel everyone..

EDDY1 11-26-2014 03:27 AM

I would resize sda2 if it's not full
It looks like you have some free space between sda2 & sda3
I would also boot to gpated-live cd/usb
Move sda3 to the left
Grow sda4 to the left
Move sda5 to the left
Move sda6 to the left
Use unallocated space for new install

EDDY1 11-26-2014 03:32 AM

You have 32.4G free space between sda2 & sda3 move it to the other side of sda6

Teufel 11-26-2014 03:40 AM

Do not touch extended partition! It will remove your swap and home partitions!
Extended patition was created when you installed Arch.

EDDY1 11-26-2014 03:43 AM

Quote:

Originally Posted by Teufel (Post 5275261)
Do not touch extended partition! It will remove your swap and home partitions!
Extended patition was created when you installed Arch.

The OP can move the partition & if they wanted to can delete but would have to edit fstab to reflect the change.
Which would make sda6 sda5

Teufel 11-26-2014 03:55 AM

Yes, he can move extended partition. When I wrote "do not touch" I meant "do not delete" it, because OP wrote:
Quote:

...I can remove it if need be...
Removing extended partition will remove sda5 & sda6 and you can't restore them simply by editing fstab.

EDDY1 11-26-2014 04:02 AM

Quote:

Originally Posted by Teufel (Post 5275268)
Yes, he can move extended partition. When I wrote "do not touch" I meant "do not delete" it, because OP wrote:

Removing extended partition will remove sda5 & sda6 and you can't restore them by editing fstab.

My apologies I misread your post or should I say didn't read into it enough & made a statement too hastily.

fatmac 11-26-2014 06:00 AM

Quote:

When I installed Arch I created 3 partitions; one for '/', one for '/home' and the other was my for swap. I was wanting to see if I could move the /home and/or swap partitions to the '/' partition so that I can install Kali on my machine via my USB stick (no CD drive)... My '/' partition is set to /dev/sda3 , /home partition is set to /dev/sda6 , swap partition is set to /dev/sda5 and for some reason I have an extended partition on /dev/sda4 that I am currently not sure what is being stored there. Anyways, I'd appreciate any help I could get as to how I can put my Arch Linux partitions into 1 big partition or maybe even 2 partitions if needed but the least partitions the better so that I can attempt to install Kali on a newly created partition.
After you have copied, as root, your whole /home/<username>, [all your data, including .(dot) files], from your present /home directory into your (sda3) / as something like /tmp-home, alter your /etc/fstab on /dev/sda3 so that it no longer points to /dev/sda6, copy all of /tmp-home to your /home directory, rename it /home/<username>, run chown -R <user>:<group> /home/<username>, then reboot. Everything should be working as normal.

You can now use sda6 to install to, (your present swap partition will be used by your new installation as well as your original distro).

Your sda4 partition holds the info about your extended partitions.

yancek 11-26-2014 07:49 AM

If you move sda3 to the left, your location for boot files will also be moved so the Grub code in the mbr will not be able to find its files, they won't be in the specified location so I expect you will need to chroot into Arch and reinstall Grub.

Is there any reason why you did not use GPT partitioning with this system? If you had, you could simply have shrunk sda2 and created another primary partition there for your install.

Teufel 11-26-2014 08:04 AM

Patitioning schema was messed from the very beginning so it isn't a good idea to keep things like they exists now. Yes home content migth be moved to root partition, but there might be no enough free space to fit home files.
I noticed the OP removed free space before sda3 (but where this free space gone?) and I think partitions completely messed. And now its a good reason to bring everything in order
I would suggest the following:
1. Backup Arch root & home filesystems
2. Remove all the partitions except sda1 and sda2
3. Create extended partition for all the rest free space
4. Create 3 partitions inside the extended one so they would be populated with two linux systems plus swap. Do not separate home from root.
5. Move Arch backup to his partition and restore bootloader to get Arch bootable. I would rather reinstall Arch at all.
6. Install Kali at his partition and add it to boot menu.

And do not use Windows for any partitioning/deleting/moving operations. Do it from Linux liveCD/USB

njdevils9 11-26-2014 11:09 PM

3 Attachment(s)
Quote:

Originally Posted by EDDY1 (Post 5275253)
I would resize sda2 if it's not full
It looks like you have some free space between sda2 & sda3
I would also boot to gpated-live cd/usb
Move sda3 to the left
Grow sda4 to the left
Move sda5 to the left
Move sda6 to the left
Use unallocated space for new install

When you say move each sda (3-6) to the left what do you mean? How do you go about doing that? The only programs I see installed that have anything to do with viewing and possibly configuring my partitions is either the program called Disks, Disk Usage Analyzer or KDisks free.. I'm terrible with working with partitions especially on Linux..


All times are GMT -5. The time now is 05:12 AM.