Ubuntu – How to combine separate partitions created by initial install of kubuntu

partitioning

I'm a newbie to linux. I'm still trying to figure things out. I ditched Windows 8.1 after their free upgrade to Windows 10.

I used gparted live to delete the partitions of the disk (500gb hitachi HDD) then partitioned and formatted the hdd to a ext4 format. I burned the KUbuntu 15.04 iso to a DVD and booted to perform a new install. I used the non-UEFI CD drive.

During the installation of Kubuntu the installer asked me about the size of the partition. I accepted the installations default which was two partitions each at approx 230 GB.

I thought it would be like in Windows where you could see two disk drives and be able to save to either one. Once I got into the new OS I can see both drives listed. When I click on the second partition I see a folder in their but cannot open the folder. I cannot add a new folder to the drive to save anything onto it. The second partition seems to have no purpose. I used gparted to see the partitions and it lists the second partition as an extended partition. It shows approx 10 gb used on that partition.

Now that I have everything setup the way I like it (took several hours) I would rather not start over to get the partition size right. Is there a way to either use the second partition so I can save files to it or a way to combine both partitions together without losing anything? Of course I would back up before I would do anything just in case.

lsblk command in terminal:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0 235.4G  0 part /media/sesslercory/0562fcf0-4d4e-4
├─sda5   8:5    0 226.7G  0 part /
└─sda6   8:6    0   3.7G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom 

sudo parted -l:

Model: ATA Hitachi HTS54505 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B                         
Partition Table: msdos                                             
Disk Flags:                                                        

Number  Start   End    Size    Type      File system     Flags     
 1      1049kB  253GB  253GB   primary   ext4            boot      
 2      253GB   500GB  247GB   extended                            
 5      253GB   496GB  243GB   logical   ext4                      
 6      496GB   500GB  3963MB  logical   linux-swap(v1) 

ls -l:

    drwxr-xr-x 2 sesslercory sesslercory 4096 Aug 13 19:16 Desktop
    drwxr-xr-x 2 sesslercory sesslercory 4096 Aug 13 01:11 Documents
    drwxr-xr-x 2 sesslercory sesslercory 4096 Aug 16 12:06 Downloads
    drwxr-xr-x 2 sesslercory sesslercory 4096 Aug 13 01:11 Music
    drwxr-xr-x 2 sesslercory sesslercory 4096 Aug 13 01:11 Pictures
    drwxr-xr-x 2 sesslercory sesslercory 4096 Aug 13 01:11 Public
    drwxr-xr-x 2 sesslercory sesslercory 4096 Aug 13 01:11 Templates
    drwxr-xr-x 2 sesslercory sesslercory 4096 Aug 13 01:11 Videos

Best Answer

Open the other partition in the file browser and press ctrl+L. You will be shown a path. Copy it. Then open a terminal and enter

cd "[whatever path]"

Where [whatever path] is the path you copied. Keep the quotes. They don't do any harm and make things easier if there are spaces or some other characters in the path. This will set your location in the current terminal to the mount point of your second partition.

Then enter these commands:

sudo chown -R [your user name] .
sudo chmod -R 777 .
sudo chown -R root "lost+found"
sudo chmod -R 700 "lost+found"

This will set the rights the way you want them to be. The first command makes you the owner of everything on the partition. The second command gives you all rights to it, but also every other user of the computer, in case you want to have several accounts and share files this way. If you don't want to do so, change 777 to 700 (others can't do anything) or to 722 (others can only read). The last 2 commands set everything back to the previous state for the (hidden) folder "lost+found" which is a special folder which you probably never will not have to use.

Related Question