How To Safely Move Space From Windows 7/8/10 to Ubuntu (GPT + UEFI Mode)
HTML-код
- Опубликовано: 10 июл 2024
- Tiny tutorial to show how to move space from Windows 7/8/10 to Ubuntu when installed in UEFI Mode.
1. Make some space which you want to devote to Ubuntu.
1.1 Open disk management and shrink the partition which is just before starting of Ubuntu partitions.
1.2 In my case, I have three Ubuntu partitions (swap, /home and /). Identify yours.
1.3 As you can see, I have two Windows partitions with labels OS and Data. In this tutorial, I'll take 5GB of space from the Data partition and give it to / of Ubuntu.
1.4 Shrink the existing partition and leave the unallocated space as it is.
1.5 Turn off fast startup inside Windows.
1.6 That's it inside Windows.
2. Moving partitions
2.1 Boot using system rescue disk. If you don't have it already, get it from www.sysresccd.org/Download and create a bootable USB by following • How to create Bootable...
2.2 System Rescue disk is optional. You can use any Linux 'Live' media with Gparted inside it. In this tutorial, I'll use Ubuntu Installation Media. Follow • How to create Bootable... to create a bootable USB. Boot from it.
2.3 Open gparted
2.4 Turn off swap.
2.5 Since my swap partition is in between, I'm gonna delete it. I'll recreate it again, later.
2.6 Move ubuntu_home 'backwards' so that the free space is transferred between ubuntu_home and ubuntu_root partitions.
2.7 Grow ubuntu_root 'backwards' to occupy the 5GB space.
2.8 Create the swap partition at the end, occupying the remaining free space (in my case, it was 2048MB).
3. Updating /etc/fstab
3.1 Now, we need to edit fstab to tell it about the new swap partition and also check if there is any change in the UUIDs of any partitions. If there is any, we will need to update it.
3.2 Mount the partition in which Ubuntu is installed to /mnt . Use gdisk to know where that partition is.
3.3 Use the command blkid to know about the UUIDs of the new partitions.
3.4 Update the UUIDs in /mnt/etc/fstab
4. Regenerate Grub Configuration
4.1 Mount (in bind mode) some more directories. Use the command:
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt/$i ; done
4.2 Find and mount the EFI partition to /mnt/boot/efi
4.3 Chroot into /mnt
4.4 Regerate Grub Configuration.
grub-mkconfig -o /boot/grub/grub.cfg
4.5 Setup grub again.
grub-install /dev/sda
5. Done. Reboot!
Music: 00:00 - 04:48
Cold Funk - Funkorama by Kevin MacLeod is licensed under a Creative Commons Attribution license (creativecommons.org/licenses/...)
Source: incompetech.com/music/royalty-...
Artist: incompetech.com/
Music: 04:49 - 10:15
Namaste by Audionautix is licensed under a Creative Commons Attribution license (creativecommons.org/licenses/...)
Artist: audionautix.com/
Music: 10:16 - 15:13
Over Time by Audionautix is licensed under a Creative Commons Attribution license (creativecommons.org/licenses/...)
Artist: audionautix.com/
Wanna support me? Visit: / nehaljwani
Great! It worked! In fact, I am commenting this video with my Ubuntu extended version. I only have to say Thank you!
I have dual boot my system does it work?
@@nagari_ishere Yes! I have 2 operating systems too.
2020, August. Still works fine. Thank you Nehal!
Hi, while deleting the linux-swap
I got a message saying-"Unable to delete /dev/sda9!""please unmount any logical partitions having a number higher than 9"
Did u face this kinda issue?
Thanks a lot man! It was a nightmare until I watched this. Worked perfectly.
Glad to be of help! :-)
It's July 4th, 2021, and it still works. Thank you so much bro 👊🏻
2021, Mai, still works, even for Linux Mint. Thank you very much!
Absolutely clear, on point instructions, thanks a lot Nehal!! :)
Glad to be of help! :-)
The most concise and helpful video.
Thanks Sir! It was very helpful , and worked absolutely fine for me :)
Glad to be of help! :-)
Good job! Really helpful and pretty clear instructions.
Glad to be of help! :-)
great installation video :) I tried other video tutorials but this one is better than others. Big thanks to Nehal J Wani
Glad to be of assistance! :-)
Worked charmingly for me thanks!
Thanks! Working in 2020 also. Most useful vid on extension of partition in ubuntu
Thank you for trying it out!
This totally saved me! thanks! using Ubuntu 20.04
Great! it worked like a charm. Great work!!!
Thanks! This method worked pefectly for me :)
Glad that it works for you!
Great tutorial. Worked perfectly.
Glad to be of help! :-)
You the man!! Liked and Subscribed!!
A nice one, this bother me for quite some time 👍👍👍
Great tutorial, it was very helpful!!! Thanks!
Bhai, i learnt a lot of things from this video, thanks a lot😋😋😋
2021 marc 27.Still Works Fine. Thanks from colombia.
Glad you found my video useful!
There is a point where fstab file which is a read-only file and we cannot edit that file. So use the command to edit that file "sudo gedit /mnt/etc/fstab" . For those who stuck at this point.
Thank you Nehal Bro!
Works perfectly!
Very helpful dude. Thanks!
Thanks for the feedback! ;-)
Thanks you! It's perfect worked for me.
Glad to of assistance!
Thank you so much sir, booted into my expanded system... Thanks alot...
Glad to be of help! :-)
Thanks a lot! Very informative and concise.
Thank you for your comment!
It worked!!! Great. Thank you very much
Perfect guidance ! :)
Helpful video!!
Thanks a lot. It works 😎
Thank you very much, sir! Your video is helping many including me. Once again thank you so much
Glad to be of help! :-)
@@NehalJWani Sir, why have you stopped making any tutorials?
@@NehalJWani Infact, you are explaining very well
@@poojanpandya8864 Yes, it's been 4.5 years. Please share ideas and I'll make them.
Thank you so much man! Everything worked perfectly! The only difference was instead of /dev/sda, I had to use /dev/nvme0n1. Would you happen to know why?
That's because you probably have an NVME SSD instead of a spinning disk.
Thank you so much sir, works very well for me
Glad to be of assistance!
Hi I'm using a fairly old laptop which dualboots Windows 10 and Ubuntu 20.04. How do I make sure I installed Ubuntu in UEFI mode? It says in your description that this works if installed in UEFI mode. I initially partitioned 40 GB for Ubuntu but I want to add 50GB more from my Windows 10 partition. Sorry I'm a newbie. Thanks in advance.
Thanks a lot. Bahot badhiya.
Glad to be of help! :-)
great video..really very helpful
Glad to be of help! :-)
thank you mate, you helped me a lot!
Glad to be of help! :-)
Thank you so much..it worked successfully
Glad to be of help!
Tin eke Tin can you help me a moment,please. My question is in comment list, please check it out,thx.
cat /mnt/etc/fstab shows "no such file or directory"? what to do.. need help please
You have probably not mounted the correct partition on /mnt or didn't mount anything at /mnt
Hi, I have an EFI partition but i cant figure out how to execute the last part(part 4) of this video. When i run this command i get back -- mount: special device udev(devpts,proc,sysfs,tmpfs) does not exist. But i do have a partition of EFI which is 500mb, with flag-boot. Could you help me out?
Are you sure you are typing the right command? Please share output for:
sudo gdisk -l /dev/sda
I have another major problem. My Ubuntu says 'Disk is likely to fail soon'. Is this a hard disk failure? Should I replace my HDD?
Thanks mate. You just saved me some cash.
Glad to be of help! :-)
i do not have any EFI system partition... what shall i do ?? can i skip the last step ?
Ignore the EFI parts of the video.
Is it the same proces if i want to move space from Ubuntu to Windows?
The answer to that depends on the partitioning layout.
'for', 'do' and 'done' commands are not found in ubuntu 16.04.5,, how should I then regenerate my grub configuration?
Oh my bad, actually i am a beginner didn't notice it carefully these are not commands the whole line is in itself a for loop but will only work in 16.04 by issuing sudo sh -c 'for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt/$i ; done'
October 2020, worked for me as well thanks Nehal! I just have a few notes to add of my own.
Laptop: xps 13 9360 with Windows 10 and Ubuntu 20.04.1
- You can use the "Make startup disk" software that comes with Ubuntu to create a bootable USB or use "Rufus" on Windows
- my GRUB did not identify the bootable USB during startup. I had to go into my UEFI firmware settings and move the USB boot option to the top as well as enable and disable other features. You can read more here: help.ubuntu.com/community/BootFromCD
- I only needed to do steps 1 and 2 from above. After that, I restarted my computer, removed my USB and my disk space had been reallocated!
ok so i am using linux mint for this and i am stuck at
for i in /dev/ /dev/pts /proc/ /sys/ /run/ ; do mount -b $i ; done
It just spits out a help thing. would you happen to know why?
solved
i now am running into a problem where i do not have an efi partition
they are all basic data partitions except my swap ext4 and NTFS partitions
Would it be safe if I used GParted live to extend the /home partition instead of doing it with Ubuntu live with GParted inside it?
Ps- video is really helpful
Yes, it would be safe.
Hi, what can I do if the windows partition is in between the ubuntu partition and the free space?
So, let's say you have this layout:
|||
You will have to do the following (use GParted and 'move' windows_p2 to the right):
|||
Then, expand ubuntu_p1 to the right.
||
Can Anyone help me, I don't need to move any partitions because have an E drive(Windows ) Which is just above my Linux root partition (I have only one Linux partition ie, root partition and swap area )
swap is below the root partition so basically it doesn't interfere here, hence I don't want to delete it, right?
All want to do is shrink the E: drive and expand the Linux root partition.
I only gave one doubt , In last part of the video your reconfiguring the grub, because in your case you delete and created a new swap area, and moved your Linux-home partition.
I JUST WANT TO KNOW WHETHER I HAVE TO RECONFIGURE THE GRUB
I am assuming that in MY CASE (just shrinking E drive and Expanding Linux-root partition) I don't have to reconfigure GRUB
Please reply anyone
Is the process different if I used ubuntu legacy mode?
+Karan Chahal The logic is almost same. Only in that, you will be dealing with Logical partitions (if you have more than four primary partitions) and nothing related to EFI partition.
Does your Ubuntu storage have to be LVM or is it not necessary?
Nope, not necessary
In the last step you setup grub again by doing
grub-install /dev/sda
but i think you do this as you EFI filesystem is in
/dev/sda1
Am i right about this? Asking cause my EFI system is in
/dev/sdb1
so should i do
grub-install /dev/sdb
Yes, you can use /dev/sdb
@@NehalJWani Thanks I did it haha before your reply I had to but thanks now this might help other people
why cant i find swapfile when i run cat /mnt/etc/fstab? is that a problem? please help me
glad i figured it out by adding swap manually to fstab.. more importantly my ubuntu is finally expanded THANK YOU VERY MUCH
Hi, can I Hangouts you I met problem in the step of 'cat /mnt/etc/fstab', it say "no such file or directory". BTW, I am newbie from Ubuntu, thanks.
I browser /mnt, this directory only have one directory which I run "mount /dev/sdb4 /mnt".
Let me say clear, I expand home directory, so everything is ok as this video tutorial, now I stuck in step 3 Updating /etc/fstab. I just run 'mount /dev/sdb4 /mnt', then I run 'cat /mnt/etc/fstab', it says no such file or directory.
Eventually, I fixed it.I found where '/' locate and mount it. You video helped me expand my home partition. Thx a lot.🤗🤗
Sorry for the late reply. I was very busy today. I'm glad it's all sorted out for you.
@@chongwang4094 i am having the same error can you help me out
What if i have the ubuntu boot as a partition not directory
how can i mount boot partition into EFI?
Assuming it is the EFI partition you are talking about, you have to mount that partition to /boot/efi using the mount command. But if it is a legacy installation, then you have to mount it to /boot. I haven't created a video for Legacy installations yet.
It all worked but there's one big problem after doing what you did. My sound starting making an enormous noise even with the headphones plugged in. It is in windows and ubuntu... Can you help me? Reinstalled device on windows and nothing
None of these changes here have anything to do with Sound. This seems like a connectivity/hardware issue if it happens in both operating systems.
First of all, awesome video! But I have a problem. I have my EFI partition in sda1. I'm booting from an usb. All goes well until I do `grub-mkconfig -o /boot/grub/grub.cfg`, it tells me:
`grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.`
I need some help please!
Okay, now I got the GRUB right (I guess), but when I boot into Ubuntu I get:
`Welcome to emergency mode! After logging in, type journalctl -xb...`
And I can't get past that. :/
FINALLY! I got it to work. The problem was that in my /etc/fstab I didn't have a UUID for swap and I added it, and that broke everything lol. So I just remove that and it worked. (In fact I didn't even have a swap partition, but I made it anyway, I don't know if that's fine or not) The important part is that now it's working and it's expanded so THANK YOU!
@@ProduccionesLukaz I am glad that you figured it out on your own! Kudos!
@@ProduccionesLukaz im having the same problem as you, can you explain more specific how you fixed that please
Can i do these steps knowing that i'm using dual boot not vm ???
Yes
can I run kali using core 2 duo ?
Most likely, yeah!
Ok, thanks men
July 2021, Did somebody encounter an error when reaching at fstab stage.
I did the command cat /mnt/etc/fstab
It says that there is no such file or directory
This happens when the mount step (3.2) is unsuccessful.
@@NehalJWani I am unsure if that's the case. I also thought it the same way. But the 3.2 command executed successfully as in the video and then the UUID is not shown in the fstab. At the end, it throws the no such file error.
@@sharangkaul2253 Check the contents of /mnt. Do they match the contents of a root filesystem? If not, then you are mounting the wrong partition
This is too complicated
Can I extend without cd or bootable usb
'Moving' a live partition or extending backwards is not possible while it is mounted. Hence, this procedure has to be done while installed Linux is not booted.
How to change you 'ubuntu' to 'root' in this try Ubuntu mode?
Open terminal, type 'sudo su'
Nehal J Wani thx, I got it.
bro how can i do that for a legacy mode i try this but it is not working when i reboot it is show a black screen with just a grub name
For the legacy mode you basically need to follow all steps except anything to do with EFI partition
@@NehalJWani I do it but it is not working
I have the first partition is the boot partition and th second is the / partition and others is home partition and swap partition
step 3 and step 4 are for those whose swap partition is in between the ubuntu and unallocated partion????????
No, its for everyone. If your swap partition was already at the end, you don't need to recreate it.
Thanks 😇
I just have 1 ext4 type in gparted....how do i approach...also l dont have 'swap' part.......plzzzzzzzz hellpppp me sir...
If you don't have the swap partition, you can ignore the steps related to the swap partition.
Was there any kind of data lost
Not if you follow the tutorial correctly.
Help, it says, "Mount point does not exist"
If this is at step 4, reboot and try again, you might have made a typo.
Can you please explain this. I can't see swap partittion in gparted, when booting from usb (ubuntu). So I can't turn off swap (step 2.4) . I want to add some space to linux mint cinamon system.
It is not mandatory that you would have a swap partition.
@@NehalJWani so I can just skip this step and move to the next one?
@@alili3664 Yes
@@NehalJWani thanks!
Good job but it will be better that if you add voice.
Thank you for your suggestion. I'll try to incorporate it in future work.
One more sudo error fix (while regenerating Grub config) :
for i in /dev /dev/pts /proc /sys /run/ ; do sudo mount -B $i /mnt/$i; done
mount: /mnt/boot/efi/: mount point does not exist.
If the directory /sys/firmware/efi doesn't exist, then you have not booted in UEFI mode.
There is another thread for this. it might be helpful for you guys. askubuntu.com/questions/871825/add-more-disk-space-for-linux-from-windows-in-a-dual-bootable-machine
I would like to ask if I did something wrong? I keep getting an error whenever I move a partition. I'm stuck. Can someone help me? Thanks
Please share the error that you are seeing. A screenshot would help.
why the fuck i don't have gray area to move backwards my partition?
Cat no such file directory
Dude help me out man i am stuck
I am still stuck over the same thing dude, please help me out. In my case it was the sda 10 whose size was increased by me
@@nightcrusader5047 Which step are you stuck at? Check the video description and share the step number.
Didnt work. (PROBLEM IS SOLVED)
Could you please be more specific as to what didn't work for you? If you have a question to ask, please go ahead. I'll respond here.
Nehal J Wani i deleted everthing from ubuntu... And know when i start my pc this FUCKING gnu grib pops up... I know its the wrong vid... But you did an video how to uninstall Linux ( Ubuntu)
You were not supposed to do that. Send a chat request to me on hangouts and I'll assist you there.
Nehal J Wani Where?
On hangouts.google.com , search my name.
yar plz music hatadou
yaar mute button daba lo :)
My recent videos don't have the bg music.
@@NehalJWani wohi kiya,lkn ais video par zaroorat nahi