Not sure if I partitioned disk when installing ubuntu

kalimochito67

New Member
Credits
96
Hi all,
The title might seem a bit silly, but was not sure how to phrase it properly.

I had a laptop with Windows and a few days ago I installed Ubuntu on it. My intention was to overwrite everything and only have Ubuntu - during the installation process I selected the overwrite option, not dual boot. Now, today I was playing a bit with my new OS and was checking the hard drive with fdisk. It told me that my disk is partitioned into 5, with Ubuntu only occupying 43 GB (out of a total of 256), and three of them belonging to Microsoft. My question is: did I do everything correctly, i.e. will Ubuntu take the currently Microsoft-occupied space when needed? Or did I create a partition where I only gave 43 GB to Ubuntu, forever and ever? Basically wondering if I need to re-install or not...
The output of fdisk is below:

/dev/sda1 2048 534527 532480 260M EFI System
/dev/sda2 534528 567295 32768 16M Microsoft reserved
/dev/sda3 567296 406657826 406090531 193,7G Microsoft basic data
/dev/sda4 498479104 500117503 1638400 800M Windows recovery environment
/dev/sda5 406659072 498479103 91820032 43,8G Linux filesystem

Thanks a lot everyone! :)
 


kalimochito67

New Member
Credits
96
Output of df -h

Filesystem Size Used Avail Use% Mounted on
udev 3,8G 0 3,8G 0% /dev
tmpfs 783M 2,1M 781M 1% /run
/dev/sda5 43G 29G 13G 71% /
tmpfs 3,9G 268M 3,6G 7% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 3,9G 0 3,9G 0% /sys/fs/cgroup
/dev/loop1 180M 180M 0 100% /snap/blender/47
/dev/loop2 256K 256K 0 100% /snap/gtk2-common-themes/13
/dev/loop3 139M 139M 0 100% /snap/inkscape/8049
/dev/loop0 115M 115M 0 100% /snap/audacity/699
/dev/loop4 127M 127M 0 100% /snap/signal-desktop/333
/dev/loop6 2,3M 2,3M 0 100% /snap/gnome-system-monitor/148
/dev/loop7 55M 55M 0 100% /snap/core18/1880
/dev/loop11 256M 256M 0 100% /snap/gnome-3-34-1804/36
/dev/loop8 98M 98M 0 100% /snap/core/10185
/dev/loop9 34M 34M 0 100% /snap/gtkhash/397
/dev/loop5 97M 97M 0 100% /snap/keepassxc/1136
/dev/loop12 51M 51M 0 100% /snap/snap-store/481
/dev/loop10 218M 218M 0 100% /snap/gnome-3-34-1804/60
/dev/loop14 261M 261M 0 100% /snap/kde-frameworks-5-core18/32
/dev/loop13 50M 50M 0 100% /snap/snap-store/467
/dev/loop15 30M 30M 0 100% /snap/snapd/8542
/dev/loop16 291M 291M 0 100% /snap/vlc/1700
/dev/loop17 63M 63M 0 100% /snap/gtk-common-themes/1506
/dev/loop18 31M 31M 0 100% /snap/snapd/9721
/dev/loop19 251M 251M 0 100% /snap/gimp/297
/dev/loop20 163M 163M 0 100% /snap/gnome-3-28-1804/145
/dev/loop21 56M 56M 0 100% /snap/core18/1885
/dev/sda1 256M 34M 223M 14% /boot/efi
/dev/loop22 170M 170M 0 100% /snap/spotify/42
tmpfs 783M 44K 783M 1% /run/user/1000
 

dos2unix

Well-Known Member
Credits
2,798
Yep...
I thought it was possible you might have those partitions mounted somehow, but no.

You have a couple of options....
You could run fdisk and re-install (this would be the easiest)

Option #1. *WARNING* This will erase entire hard drive!!
fdisk /dev/sda
g
(enter)
w (enter)
reboot/re-install.

..or... you can simply format the two windows partitions and mount them.

mkfs.ext4 /dev/sda3
mkfs.ext4 /dev/sda4

mkdir /extraspace1
mkdir /extraspace2

mount /dev/sda3 /extraspace1
mount /dev/sda4 /extraspace2


run df -h again.

If you like this, we can go through some steps to make this permanent.

blkid /dev/sda3
blkid /dev/sda4


then edit your /etc/fstab file.
 

kalimochito67

New Member
Credits
96
Thanks a lot for your answer! I think I will try the second option, just to not have to go again through all the extra set-up...
So if I understand right, you tranfer the space of those partitions into these new folders, and then? what do you mean by making this permanent?
I tried looking up what blkid does, but was not clear to me...
 

dos2unix

Well-Known Member
Credits
2,798
If you reboot your computer those mounted filesystems will "go away".
It's not a big deal, you can always remount them. To prevent this..

Run blkid

[[email protected]]# blkid /dev/sda3
/dev/sda3: UUID="a2d9d70a-934d-4819-98ca-9b1c494f9db8" TYPE="xfs" PARTUUID="cb05d352-cf67-40dd-a85e-cb9e6474c0ef"

The only part of this line that we care about is the UUID=somereallylongstring
When you run this command on your computer, it will have a different UUID than
the one I posted as an example. Copy the part I have in red above from your command.

Now you need to edit your /etc/fstab file. You will need root permissions to do this.
I would recommend making a backup of this file.
sudo cp /etc/fstab /etc/fstab20201026
If you are familiar with vi or pico you can type this sudo vi /etc/fstab

add this line to the bottom of the /etc/fstab file (paste is much easier)
UUID=277f05c3-52c1-4139-9553-ae6532e071c6 /extraspace1 ext4 defaults 0 0

note that your UUID will be different from mine, use yours.
I have noticed some versions of Linux do not like the double quotes around the UUID.
repeat these steps for /dev/sda4

sudo blkid /dev/sda4
and paste the UUID part into your /etc/fstab
make sure you change the second line to /extraspace2 (not /extraspace1)

Now when you reboot, they will automatically be there.
 

kalimochito67

New Member
Credits
96
So, after the first steps and mounting, the first time I run blkid, it gave me something like this:

/dev/sda3: LABEL="RECOVERY" UUID="6464E8CA64E89FD2" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="11657c3e-6360-4072-b7f9-1cd42c97ef4d"

with the UUID being in a very different format to what you described. However, after changing the fstab file, the output of blkid changed to the format you described:

/dev/sda3: UUID="6328ced2-3479-4cc6-993a-3a4b2e6c86c4" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="7fa7ecc4-69c3-4d10-a975-e725179d9c22"

Hence, I changed the fstab file again to account for the new UUID. After this, the output of blkid stayed constant. However, after I did the same for sd4, blkid's output did not change and is still of the prior form, which confuses me.
Did I fix it correctly for sda3, fdisk still tells me there is a MIcrosoft Basic Data partition there? And what went wrong for sd4?


If it helps, running fdisk -l, I still get:

/dev/sda1 2048 534527 532480 260M EFI System
/dev/sda2 534528 567295 32768 16M Microsoft reserved
/dev/sda3 567296 406657826 406090531 193,7G Microsoft basic data
/dev/sda4 498479104 500117503 1638400 800M Windows recovery environment
/dev/sda5 406659072 498479103 91820032 43,8G Linux filesystem

and running df -h

Filesystem Size Used Avail Use% Mounted on
udev 3,8G 0 3,8G 0% /dev
tmpfs 783M 2,1M 781M 1% /run
/dev/sda5 43G 29G 13G 71% /
tmpfs 3,9G 271M 3,6G 7% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 3,9G 0 3,9G 0% /sys/fs/cgroup
/dev/loop1 180M 180M 0 100% /snap/blender/47
/dev/loop2 256K 256K 0 100% /snap/gtk2-common-themes/13
/dev/loop3 139M 139M 0 100% /snap/inkscape/8049
/dev/loop0 115M 115M 0 100% /snap/audacity/699
/dev/loop4 127M 127M 0 100% /snap/signal-desktop/333
/dev/loop6 2,3M 2,3M 0 100% /snap/gnome-system-monitor/148
/dev/loop7 55M 55M 0 100% /snap/core18/1880
/dev/loop11 256M 256M 0 100% /snap/gnome-3-34-1804/36
/dev/loop8 98M 98M 0 100% /snap/core/10185
/dev/loop9 34M 34M 0 100% /snap/gtkhash/397
/dev/loop5 97M 97M 0 100% /snap/keepassxc/1136
/dev/loop12 51M 51M 0 100% /snap/snap-store/481
/dev/loop10 218M 218M 0 100% /snap/gnome-3-34-1804/60
/dev/loop14 261M 261M 0 100% /snap/kde-frameworks-5-core18/32
/dev/loop13 50M 50M 0 100% /snap/snap-store/467
/dev/loop15 30M 30M 0 100% /snap/snapd/8542
/dev/loop16 291M 291M 0 100% /snap/vlc/1700
/dev/loop17 63M 63M 0 100% /snap/gtk-common-themes/1506
/dev/loop18 31M 31M 0 100% /snap/snapd/9721
/dev/loop19 251M 251M 0 100% /snap/gimp/297
/dev/loop20 163M 163M 0 100% /snap/gnome-3-28-1804/145
/dev/loop21 56M 56M 0 100% /snap/core18/1885
/dev/sda1 256M 34M 223M 14% /boot/efi
/dev/loop22 170M 170M 0 100% /snap/spotify/42
tmpfs 783M 56K 783M 1% /run/user/1000
/dev/sda3 190G 61M 180G 1% /extraspace1
/dev/sda4 772M 1,6M 714M 1% /extraspace2
 

kalimochito67

New Member
Credits
96
OK, now the output of blkid on both cases gives me the right format, and changed the fstab accordingly.

I had done the mkfs.ext4 commands, I tried again on sd4, and it told me:

/dev/sda4 contains a ext4 file system
last mounted on Mon Oct 26 20:21:35 2020
Proceed anyway? (y,N) y
/dev/sda4 is mounted; will not make a filesystem here!

After that, blkid started outputting the right format, so maybe it needed some sort of updating? and trying to build the filesystem again triggered it?

In any case, both are now TYPE="ext4" PARTLABEL="Basic data partition", the fstab file is updated and everything seems constant between after booting. fdisk still tells me there are microsoft partitions though, as mentioned in my previous comment. Should I ignore it? If so, I understand right that ubuntu will just take more space as it needs in the future? (and thanks so much, dos2unix)

The output of df -h just in case:

Filesystem Size Used Avail Use% Mounted on
udev 3,8G 0 3,8G 0% /dev
tmpfs 783M 2,0M 781M 1% /run
/dev/sda5 43G 29G 12G 71% /
tmpfs 3,9G 28M 3,8G 1% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 3,9G 0 3,9G 0% /sys/fs/cgroup
/dev/loop1 180M 180M 0 100% /snap/blender/47
/dev/loop2 98M 98M 0 100% /snap/core/10185
/dev/loop3 251M 251M 0 100% /snap/gimp/297
/dev/loop0 115M 115M 0 100% /snap/audacity/699
/dev/loop4 218M 218M 0 100% /snap/gnome-3-34-1804/60
/dev/loop6 163M 163M 0 100% /snap/gnome-3-28-1804/145
/dev/loop7 291M 291M 0 100% /snap/vlc/1700
/dev/loop9 256M 256M 0 100% /snap/gnome-3-34-1804/36
/dev/loop10 97M 97M 0 100% /snap/keepassxc/1136
/dev/loop11 127M 127M 0 100% /snap/signal-desktop/333
/dev/loop8 261M 261M 0 100% /snap/kde-frameworks-5-core18/32
/dev/loop5 30M 30M 0 100% /snap/snapd/8542
/dev/loop12 51M 51M 0 100% /snap/snap-store/481
/dev/loop13 56M 56M 0 100% /snap/core18/1885
/dev/loop14 139M 139M 0 100% /snap/inkscape/8049
/dev/loop17 34M 34M 0 100% /snap/gtkhash/397
/dev/loop16 50M 50M 0 100% /snap/snap-store/467
/dev/loop15 2,3M 2,3M 0 100% /snap/gnome-system-monitor/148
/dev/loop20 63M 63M 0 100% /snap/gtk-common-themes/1506
/dev/loop21 256K 256K 0 100% /snap/gtk2-common-themes/13
/dev/loop19 170M 170M 0 100% /snap/spotify/42
/dev/loop22 31M 31M 0 100% /snap/snapd/9721
/dev/sda4 772M 1,6M 714M 1% /extraspace2
/dev/sda3 190G 61M 180G 1% /extraspace1
/dev/sda1 256M 34M 223M 14% /boot/efi
tmpfs 783M 20K 783M 1% /run/user/1000
/dev/loop23 56M 56M 0 100% /snap/core18/1932
 


Members online


Top