Score:0

suggestions in partitioning root space to create space for a second distro

ma flag

I need to shring space of root partition on my disk to create a new partition for the installation of another distro (I have now Ubuntu/Kde Plasma and I want to have a dual boot with EndeavourOS). I think I know how to do this, but since it is quite a risky procedure, I may want to ask your advices!

The configuration is apparently simple (both GParted and KDE partition manager gives me this:)

unallocated

2MB

/dev/nvme0n1p1

mount point: /boot/EFI (fat32) 300MB (5.24MB used)

/dev/nvme0n1p2

mount point: / (ext4) 238.17GB (127.08GB used)

unallocated

7.20MB


But when "lsblk" gives me quite a number of loops, that's why I prefer to ask before loosing data:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0 162,9M  1 loop /snap/gnome-3-28-1804/145
loop1         7:1    0  63,6M  1 loop /snap/handbrake-jz/142
loop2         7:2    0    68K  1 loop /snap/acrordrdc/53
loop3         7:3    0    68K  1 loop /snap/acrordrdc/62
loop4         7:4    0   285M  1 loop /snap/atom/282
loop5         7:5    0 284,9M  1 loop /snap/atom/286
loop6         7:6    0     4K  1 loop /snap/bare/5
loop7         7:7    0 114,9M  1 loop /snap/core/13741
loop8         7:8    0   115M  1 loop /snap/core/13886
loop9         7:9    0  55,6M  1 loop /snap/core18/2560
loop10        7:10   0  55,6M  1 loop /snap/core18/2566
loop11        7:11   0  63,2M  1 loop /snap/core20/1623
loop12        7:12   0  63,2M  1 loop /snap/core20/1634
loop13        7:13   0  33,2M  1 loop /snap/crystal/1349
loop14        7:14   0  33,2M  1 loop /snap/crystal/1367
loop15        7:15   0   6,3M  1 loop /snap/curl/1093
loop16        7:16   0   6,3M  1 loop /snap/curl/1113
loop17        7:17   0 164,8M  1 loop /snap/gnome-3-28-1804/161
loop18        7:18   0 346,3M  1 loop /snap/gnome-3-38-2004/115
loop19        7:19   0   219M  1 loop /snap/gnome-3-34-1804/77
loop20        7:20   0 346,3M  1 loop /snap/gnome-3-38-2004/119
loop21        7:21   0  81,3M  1 loop /snap/gtk-common-themes/1534
loop22        7:22   0   140K  1 loop /snap/gtk2-common-themes/13
loop23        7:23   0  91,7M  1 loop /snap/gtk-common-themes/1535
loop24        7:24   0  29,2M  1 loop /snap/node/6800
loop25        7:25   0  29,2M  1 loop /snap/node/6853
loop26        7:26   0 101,5M  1 loop /snap/p7zip-desktop/220
loop27        7:27   0 184,4M  1 loop /snap/signal-desktop/398
loop28        7:28   0 141,1M  1 loop /snap/skype/231
loop29        7:29   0 184,1M  1 loop /snap/signal-desktop/397
loop30        7:30   0 141,5M  1 loop /snap/skype/234
loop31        7:31   0    48M  1 loop /snap/snapd/17029
loop32        7:32   0    48M  1 loop /snap/snapd/17336
loop33        7:33   0 303,1M  1 loop /snap/wine-platform-5-stable/16
loop34        7:34   0 303,1M  1 loop /snap/wine-platform-5-stable/18
loop35        7:35   0 322,9M  1 loop /snap/wine-platform-6-stable/14
loop36        7:36   0 322,9M  1 loop /snap/wine-platform-6-stable/19
loop37        7:37   0 347,1M  1 loop /snap/wine-platform-runtime/315
loop38        7:38   0   347M  1 loop /snap/wine-platform-runtime/316
loop39        7:39   0   2,5M  1 loop /snap/ymuse/61
loop40        7:40   0   250M  1 loop /snap/zoom-client/170
loop41        7:41   0   2,5M  1 loop /snap/ymuse/54
loop42        7:42   0 352,4M  1 loop /snap/zoom-client/175
nvme0n1     259:0    0 238,5G  0 disk 
├─nvme0n1p1 259:1    0   300M  0 part /boot/efi
└─nvme0n1p2 259:2    0 238,2G  0 part /

and so "fdisk -l"

Disk /dev/loop0: 162,87 MiB, 170778624 bytes, 333552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 63,59 MiB, 66674688 bytes, 130224 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 68 KiB, 69632 bytes, 136 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 68 KiB, 69632 bytes, 136 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 285,05 MiB, 298893312 bytes, 583776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 284,93 MiB, 298774528 bytes, 583544 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 4 KiB, 4096 bytes, 8 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 114,93 MiB, 120508416 bytes, 235368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/nvme0n1: 238,47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: ADATA SX8200PNP                         
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 729952F6-973B-7E48-A50F-47CBB14D3987

Dispositivo     Start      Fine   Settori   Size Tipo
/dev/nvme0n1p1   4096    618495    614400   300M EFI System
/dev/nvme0n1p2 618496 500103449 499484954 238,2G Linux filesystem


Disk /dev/loop8: 114,99 MiB, 120573952 bytes, 235496 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

...

I want to create a new partition (~70GB) taking space from "/dev/nvme0n1p2" (free space 110.08GB), can I indicate the new sectors considering them as being proportionally related to the space? I mean, if this is the partition:

/dev/nvme0n1p2 (start) 618496 (end) 500103449 (total sectors) 499484954 238,2G

can I set the things like

/dev/nvme0n1p2 (start) 618496 (end) 353300970 (total sectors) 352682475 168,17G

/dev/nvme0n2p1 (start) 353300971 (end) 500103449 (total sectors) 146802479 70,0G

Can I do that with fdisk? I know I can do it directly during the installation of the new distro, but it seems to me a bit risky and I wanted to do this separately. Any suggestions?

thanks R

guiverc avatar
cn flag
Does this answer your question? [How to resize partitions?](https://askubuntu.com/questions/126153/how-to-resize-partitions)
David avatar
cn flag
It would help a lot to see a screen shot of the output of Gparted. The location of the partitions in relation to each other is important. It can be seen much easier in the GUI app.
Riccardo D. Wanke avatar
ma flag
yes, unfortunately it seems I am not allowed to add pictures (I guess because I am a beginner here).
Riccardo D. Wanke avatar
ma flag
thank you guiverc! So, I guess the most secure process is with Gparted live, isn't it?
guiverc avatar
cn flag
If it was me, I'd just resize using the tool I know best, as there are many that will do the job, but most problems will be caused by mistakes & using the tool you know best I feel would limit those mistakes. Ubuntu has ISOs with 5 installers available, each has *pros* & *cons* but Endeavour is off-topic here, but you could do it with various of the Ubuntu installer tools (*I know as I'm involved in QA & do it often with them*), but as stated I'd use the tool you're most familiar with.
Riccardo D. Wanke avatar
ma flag
Besides, the way to do this partitioning. I wanted to understand if I can consider sectors and bytes as linearly equivalent. That is to say that if I have for instance a partition 50% full (with total sectors from 1 to 100.000), I can –in principle– create another partition from it which starts at sector 50001 without losing data?
guiverc avatar
cn flag
Your *logic* may apply assuming you've created specific file-system(s) in the partition, and *never* deleted any files within it, as file-space/inodes allocated to files can be anywhere on the partition & the *fs* involved can influence how sectors/inodes are allocated... ie. don't make assumptions if you value your data; reduce the partition size from the partition table
Riccardo D. Wanke avatar
ma flag
i will do that. thank you
Riccardo D. Wanke avatar
ma flag
Just as an update. Everything is done. Partitions resized successfully! thanks to eveyone.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.