You are not logged in.
Hello there!
I have a Thinkpad X1 Carbon that I dualboot Arch Linux and Windows 10 on. On Windows I have roughly 400GB of storage and on my Arch I only have roughly 30GB. I use my Linux boot a whole lot more than I do my Windows but, unfortunately, I have to keep the dualboot for school etc. I want to move about 150GB, to start off with, from Windows to Arch and keep all the files etc on both of them. Windows has more than 150GB free so it should be alright.
I have tried to follow this video: https://www.youtube.com/watch?v=yOOcg5Cm4DM
but I can't seem to figure it out. I have resized my C:// drive on Windows successfully so that I have 150GB of unallocated space.
This is how it looks like now: https://imgur.com/QsM08Az
In the video is says that the unallocated space needs to be before Linux's storage so I tried to move it next to it but to no success. I can't move the the stuff in between; https://imgur.com/a/Ahpi7JI
I moved the EFI System Partition "one step up" so that the unallocated took it's place and now I can not boot into Arch. I get greeted with grub-rescure.
So, I'm wondering how do I successfully increase the storage of Arch?
Thank you and have a great day!
Last edited by FlatEarthGary (2021-12-22 16:20:45)
Offline
You'll probably have to move your system partition back to the beginning of your drive. Use a rescue disk first to back up all your data to an external drive.
If you have 150GB of unallocated space, and it is adjacent to your arch linux install partition, the way I know of is to use fsarchiver from a rescue disk to take an image of your arch stuff, store that image onto an external drive, then blow away the arch partition, and create one partition that spans the 150 GB and 30 GB of space, then use fsarchiver again to place back your image to that new partition.
Offline
Why not just make a new partition on the 150GB space for a home partition, then leave everything else alone. Moving partitions can be problematic, but the 30G for your arch system would be more than enough for a root partition if all of /home was moved onto the 150G space.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yeah, that would be easier, just mount the 150GB as /home in fstab.
Still need to move the EFI partition so it is first, right? If I remember correctly, the UEFI spec requires it to be first?
Offline
Offline
I moved *the* EFI System Partition...
emphasis mine
I don't think he has two EFI partitions? Just moved it around? He should clarify, though.
Last edited by bbus (2021-12-22 18:58:17)
Offline
Offline
Why not just make a new partition on the 150GB space for a home partition, then leave everything else alone. Moving partitions can be problematic, but the 30G for your arch system would be more than enough for a root partition if all of /home was moved onto the 150G space.
Thank you for your response!
If I were to do that would everything stay intact and only the size of the /home directory get changed? If so that sounds like a solid approach but the problem is that I don't really know how to do that. Right now when I try to boot into Arch I get greeted with grub-rescue "error: unknown filesystem" and can't really do anything. How would you suggest I'd go about it?
Thank you and have a great day!
Last edited by FlatEarthGary (2021-12-22 19:25:08)
Offline
Why do you have 2 EFI partitions? You only need one in each system.
Hmm, it does seem like I have two but isn't that as it should since I'm dualbooting? Two EFI partitions for two OSes?
Offline
The screenshot clearly shows 2.
oh, heh, would help if I actually looked at the screenshot. I've gotten into the habit of not opening imgur links because too often it was a picture of text.
isn't that as it should since I'm dualbooting? Two EFI partitions for two OSes?
No. You only need one, and boot boot files for each OS into respective folders. Sounds like you are using grub.
Others may have a better idea, but I would use a live disk to
- move the files from your 2nd EFI partition into your first one,
- unallocate the space from your 2nd partition (you can use fdisk, but I personally prefer gdisk for cli partition manipulation)
- chroot into your arch partition and reconfigure grub (this step I'm not familiar with, I don't use grub)
- exit the chroot
- allocate space (e.g. create a partition in the (now) 150.5GB space, and format it
- move your /home directory and fix your /etc/fstab to properly mount it
Last edited by bbus (2021-12-22 19:37:04)
Offline
If I were to [mount the 150G partition on /home] would everything stay intact and only the size of the /home directory get changed?
Almost ...
You would need to first move all the contents of /home from the current partition to the new one. Then add the entry to your fstab. But this would be much safer and much much easier than moving around the entire OS.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
FlatEarthGary wrote:If I were to [mount the 150G partition on /home] would everything stay intact and only the size of the /home directory get changed?
Almost ...
You would need to first move all the contents of /home from the current partition to the new one. Then add the entry to your fstab. But this would be much safer and much much easier than moving around the entire OS.
I see. That sounds like a good plan. I know it's a lot to ask for but could you possibly send the commands on how I would go about doing that? I'm rather new into Linux. Thank you and have a great day!
Offline
I can't give exact commands as it depends on what the device / partition is as well as the filesystem you chose to create on it. But essentially:
1. boot to single user mode, or log in only as root (do not log in your user account at all)
2. mount the new ~150G partition somewhere like /mnt
3. move all content of /home/ to wherever you mounted the new partition (e.g. `mv /home/* /mnt/`)
4. update your fstab by adding a line for your new partition to mount on /home
5. optionally `sync` then unmount /mnt
6. reboot
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'll add, careful with the "mv /home/* /mnt/" as the wild card "*" may not grab all directories and files that start with a ".", i.e. all your dot files, e.g. ".config" directory, ".bashrc" file, etc.
Just make sure everything gets moved over. You can us "ls -a" to see both, regular directories and files, and "hidden" directories and files.
Offline
# rsync -aAXHv /home/ /mnt ; syncJin, Jîyan, Azadî
Offline
I'll add, careful with the "mv /home/* /mnt/" as the wild card "*" may not grab all directories and files that start with a ".", i.e. all your dot files, e.g. ".config" directory, ".bashrc" file, etc.
None of those are directly under /home - the command I provided will move all of those files just fine. It could miss any dot-files/directories directly under /home/ but there shouldn't be any ... certainly there'd be no .config or .bashrc there.
If you use the rsync command above, you should then remove / delete everything from the old home directory as another step otherwise it will still consume space on the device despite not being accessible (even to delete) after the reboot.
Last edited by Trilby (2021-12-22 23:50:56)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Oh yeah, I read it too fast, and was thinking "/home/username", not "/home". Absolutely right, though.
It also wouldn't make sense to only move "/home/username", but to move the entire "/home" directory.
Good reminders. Cheers!
Offline
You'll probably have to move your system partition back to the beginning of your drive. Use a rescue disk first to back up all your data to an external drive.
If you have 150GB of unallocated space, and it is adjacent to your arch linux install partition, the way I know of is to use fsarchiver from a rescue disk to take an image of your arch stuff, store that image onto an external drive, then blow away the arch partition, and create one partition that spans the 150 GB and 30 GB of space, then use fsarchiver again to place back your image to that new partition.
Hello! Sorry for the late response but I hope you could still help me.
I have backed up my /home/user folder to a USB stick. The 150GB of unallocated space is adjacent of the Arch install.
I have installed fsarchiver to my Arch machine. There are plenty of options, should I "save filesystem to an archive file"? Should I then store that archive file on the same USB stick or another?
Thank you so much and happy holidays!
Offline
If you are
...rather new to linux...
I'd suggest Trilby's method in post #13. It will be easier. Once you have more experience, you could play around with fsarchiver.
If you are determined, I recommend running fsarchiver from a live-disk (e.g. the arch installer iso), as you'll be less prone to make mistakes and there are less caveats, in my own experience. To clarify, that means you don't need it installed to your system.
Offline
If you are
...rather new to linux...
I'd suggest Trilby's method in post #13. It will be easier. Once you have more experience, you could play around with fsarchiver.
If you are determined, I recommend running fsarchiver from a live-disk (e.g. the arch installer iso), as you'll be less prone to make mistakes and there are less caveats, in my own experience. To clarify, that means you don't need it installed to your system.
Okay I see. According to that solution I have to mount the unallocated space to /mnt/ but I can't figure out how. I have tried to search around but to no success. Using the mount command I have to specify what to mount and but I can't since it's not allocated. What to I type in replace of UNALLOCATED in mount UNALLOCATED /mnt/?
This is how my gparted looks like: https://imgur.com/a/NtAnufi
Note: The unallocated space is not next to where Arch is installed /dev/nvme0n1p6, is that going to be a problem. If so, how do I solve it.
I'm sorry if I'm asking lots of question and is not too knowledgeable. I really do appreciate you helping me out!
Thank you and have a great day!
Offline
You skipped step 1:
Why not just make a new partition on the 150GB space for a home partition
Note: The unallocated space is not next to where Arch is installed /dev/nvme0n1p6, is that going to be a problem.
No - that's the whole point: there is no need to move around existing partitions which is problematic. But you do have to create a new one, and create a filesystem on it, then mount that new filesystem on /mnt and proceed from there.
Last edited by Trilby (2021-12-27 21:14:16)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
You skipped step 1:
Trilby wrote:Why not just make a new partition on the 150GB space for a home partition
FlatEarthGary wrote:Note: The unallocated space is not next to where Arch is installed /dev/nvme0n1p6, is that going to be a problem.
No - that's the whole point: there is no need to move around existing partitions which is problematic. But you do have to create a new one, and create a filesystem on it, then mount that new filesystem on /mnt and proceed from there.
Okay. I have followed your advice from earlier and I have ended up with a new partition, nvme0n1p8 which has the larger size. When I mount the partition everything and look inside everything from the home folder is there. However I do not seem to use the partition. I have tried to edit the /etc/fstab file you mentioned to this:
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p6
UUID=1e5ea246-9be0-43c0-9079-9bee2db14efe / ext4 rw,relatime 0 1 [ins] I have edited the UUID here from nvme0n1p6 (the old one) to nvme0n1p8 (the newer bigger one) but when I reboot there is no difference. I still boot into the smaller disk space. [/ins]
# /dev/nvme0n1p4
UUID=BB89-A553 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/nvme0n1p5
UUID=0c1deb61-0a89-4479-935f-b353795e3aed none swap defaults 0 0Output from lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 100M 0 part
├─nvme0n1p2 259:2 0 16M 0 part
├─nvme0n1p3 259:3 0 295.7G 0 part
├─nvme0n1p4 259:4 0 512M 0 part /boot
├─nvme0n1p5 259:5 0 4G 0 part [SWAP]
├─nvme0n1p6 259:6 0 29.7G 0 part / [ins] Not using nvme0n1p8 [/ins]
├─nvme0n1p7 259:7 0 508M 0 part
└─nvme0n1p8 259:8 0 139.7G 0 partWhen I boot into my machine I can still only access the small 30GB storage.
Any help would be much appreciated! Thank you and have a great day!
Last edited by FlatEarthGary (2021-12-29 14:41:02)
Offline
First, edit your post to use code tags rather than random bold and highlight tags.
Second, you need to *add* an fstab entry for the new partition to be mounted on /home. Do not remove/replace the existing root partition entry! I'm surprised you were able to boot at all with that entry ... the only reason you can is due to your boot loader passing the root partition to init which properly mounts it - and in this case luckily ignores the bad fstab entry.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
First, edit your post to use code tags rather than random bold and highlight tags.
Second, you need to *add* an fstab entry for the new partition to be mounted on /home. Do not remove/replace the existing root partition entry! I'm surprised you were able to boot at all with that entry ... the only reason you can is due to your boot loader passing the root partition to init which properly mounts it - and in this case luckily ignores the bad fstab entry.
Thank you for your quick response and I apologize for misusing tags.
I have managed to add the fstab entry now. My fstab file now looks like this:
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p7
UUID=1e5ea246-9be0-43c0-9079-9bee2db14efe / ext4 rw,relatime 0 1
# /dev/nvme0n1p5
UUID=BB89-A553 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/nvme0n1p6
UUID=0c1deb61-0a89-4479-935f-b353795e3aed none swap defaults 0 0
# /dev/nvme0n1p8
UUID=5ef5e052-11a4-42a6-b713-d233f7a30366 /home auto rw,auto 0 0It now works, I think at least. The /home directory has access to the big storage now which is great, however only the /home folder. Correct me if I'm wrong but doesn't packages installed from pacman, for example, get stored outside the /home folder and, henceforth, gets restricted by the small size of the other partition? How do I make it so that not only the home folder gets to access this big storage so that I can install more packages? I'm thinking I can just change the /home part of the new fstab entry to / but there is already another one using / so I don't know if that is allowed/possible.
Offline
When you install new packages, they replace old ones. That was the whole point: 30G should be more than enough for system files. If your root partition is getting anywhere even remotely close to that (or even half that) I'd suspect something would be wrong and you should track down the problem rather than just giving the problem more space to fill.
How much space actually is used on the root partition? What's the output of `df -h`?
Last edited by Trilby (2021-12-29 16:06:41)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline