Ubuntu – Installed ubuntu on USB and want to resize the main partition

formatmountpointpartitioning

I installed ubuntu using the default settings on my USB 3 flash drive… but later on I found that it partitioned only 14GB for ubuntu main partition (dev/sdc2)243MB for /boot mountpoint,dev/sdc1 (already the 138 are used) and the rest of 17GB (!!!) was partitioned as a swap file! I have 16GB of ram so I would like to shrink the swap file to 1,2 GB and use the rest to resize the main partition (does the /boot mountpoint need more or a few MB are good? )

Disks app shows my usb in 2 ways

1st way as a USB device (labeled 32GB thumb drive)

Of which 255MB are labeled as "Filesystem Partition 1 ext2" /dev/sdc1

-kb labeled as "Partition 2" /dev/sdc2

31GB labeled as "Free Space" /dev/sdc/ and containts: Unallocated Space

2nd way its displayed as two seperate "devices" which are labeled as "14 GB block device" /dev/ubuntu-vg/root, Contents Ext4(version1) -mounted Filesystem root and the other labeled as "17 GB block Device" /dev/ubuntu-vg/swap_q, Contents: Swap(version 1) -active.

pvdisplay outputs the following:

--- Physical volume ---
PV Name               /dev/sdc5
VG Name               ubuntu-vg
PV Size               29,20 GiB / not usable 2,00 MiB
Allocatable           yes 
PE Size               4,00 MiB
Total PE              7474
Free PE               12
Allocated PE          7462
PV UUID               yfeuSi-lj22-DMaN-HXCi-qJNP-8ptg-22T7Da

Please give your answer to how to resize my main partition as dumped down and analytical (step by step) as possible cause I am a linux noob 😛

EDIT:

The output of lsblk is as follows:

sdc                     8:32   1  29,4G  0 disk 
├─sdc1                  8:33   1   243M  0 part /boot
├─sdc2                  8:34   1     1K  0 part 
└─sdc5                  8:37   1  29,2G  0 part 
  ├─ubuntu--vg-root   252:0    0  13,2G  0 lvm  /
  └─ubuntu--vg-swap_1 252:1    0    16G  0 lvm  [SWAP]

Best Answer

Did you try with fdisk ? It's already installed by default on ubuntu system.

fdisk /dev/sd*

Where * is the letter of your disk. When you entered in fdisk type "m" to show the commands.

Otherwise, you could try to install gparted to do with a GUI (more easier) but you need to install it first:

apt-get update && apt-get install gparted 

After you will be able to launch gparted from your applications and it's very easier to edit with it (right click with your mouse and "resize" on the correct partition.)

Then, the /boot parition contains the GRUB configuration, the kernel with their System.map, ... I think ~ 100MB or 200MB is enough so 243MB is Ok.

Related Question