this post was submitted on 29 Jan 2024
51 points (94.7% liked)

Linux

48248 readers
804 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

last year when I went back to Arch from Manjaro, I made a critical error. I'm not sure if I was just tired when partitioning things off or what. but I made my root only 20GB instead of the 50 that I had intended. I know in a lot use cases that'll be fine, but in mine, not so much. with steam compat taking up 1-2gb and keeping one version of pacman cache, I'm constantly getting the redline warning.

Tonight I plan on booting to live and resize my luks drive and hopefully not fuck it. and if I do? oh well...Timeshift will hopefully save me.

top 28 comments
sorted by: hot top controversial new old
[–] [email protected] 19 points 9 months ago (2 children)

I recommend next time to use btrfs. With / and /home (at least) as separate subvolumes. Each subvolume will use the space it needs, and no more. If you have a 500Gb SSD with 300Gb in /home, and 20 in / they both have 180Gb they can use.

And when you manage to fill the 500Gb, it's easy to just add another drive to the volume.

[–] [email protected] 3 points 9 months ago

Btrfs is really cool, just a warning: I had a surprise when I found out the subvolumes make a device more of a hassle to mount externally, you can't just put it on an external HDD enclosure and expect it to work as painlessly as it is with more "traditional" file systems, I had to mount each subvolume manually as GUI file managers only mounted the root.

It's not complicated, but more than I'd hoped for.

[–] [email protected] 2 points 9 months ago

Thx for eli5 the advantage of btrfs

[–] [email protected] 18 points 9 months ago (1 children)

UPDATE

Booted to live and used gparted. had to fiddle with un-encrypting/re-encrypting the partitions in order to move everything around correctly, but everything was successful.

nothing ended up needing to be updated in boot. systemd-boot is so basic that so long as the uuids don't change, then it don't care.

All in all a good experience.

[–] [email protected] 3 points 9 months ago

Awesome! 😎

[–] [email protected] 9 points 9 months ago (1 children)

Highly recommend using lvm in the future. You can undersize your partitions and when whichever one you need more space on it's easy to grow. Also really easy to live migrate to other drives as needed. Good luck.

[–] [email protected] 6 points 9 months ago

And you can even do this with luks on lvm.

[–] [email protected] 7 points 9 months ago

in many cases you could simply move the directory that is taking too much space to different directory then either make softlink or if that didnt work you can use mount --bind

for example if directory /var/cach/mygame is too big, move my game to /mnt/part2/mygames

then either do ln -s /mnt/part2/mygames /var/cach/ or mount --bind /mnt/part2/mygames /var/cach/mygames

the miunt option is not permanent so if it works, u will need to add it to /etc/fstab to make it permenent

[–] [email protected] 4 points 9 months ago

For future reference, you can move the pacman cache to another drive/partition.

/etc/pacman.conf

CacheDir = /path/to/cache/

[–] [email protected] 3 points 9 months ago

Remember to make sure that all the boot configs are updated correctly after the resize. It could happen that your boot manager does not find the partition to unlock after a resize

[–] Hiro8811 2 points 9 months ago (2 children)

We'll dunno much but wouldn't the UUID of the drive partition change?

[–] [email protected] 4 points 9 months ago

I don't believe it does, if It does though I can report back

[–] [email protected] 3 points 9 months ago (2 children)

If you resize the partition? No, the UUID gets allocated when the partition is created and stays the same for the lifetime of the partition. It only changes if you explicitly change it manually. Which is something that's only needed very rarely.

For example I had to do it when I migrated my root disk to a larger SSD by cat-ing the entire disk to the new one and I wanted to keep both connected for a while (so I can boot into the old one in case anything went wrong). I had to change the UUID of the partition on the new disk but I still ran into some obscure grub issues and had to boot a system rescue live stick into the new disk to update grub properly. Overall it's not a very good idea, in the future I think I'll stick to rsync -avx root into the new partition.

[–] [email protected] 1 points 9 months ago (1 children)

In my case it actually changed after i resized it. It was unexpected and broke my system. After i adjusted the UUID in the boot config it worked again.

[–] [email protected] 1 points 9 months ago (1 children)

That's really unusual and yeah I can see how that would surprise you. What tool did you use to resize it?

[–] [email protected] 1 points 9 months ago (1 children)

Thinking about what i did (already a few weeks ago) i think it makes sense now. A lot of sources suggested it would be easiest to delete the partition and simply create a new bigger one at the same start blocks. And then resize the FS. Then it actually makes sense why i ended up with another UUID.

[–] [email protected] 1 points 9 months ago (1 children)

Ahhhh I see now, that explains it. 😃 Yeah it's not a bad method if you need to resize a partition in place, but you need to be super careful to restore all the partition parameters like sector size etc. exactly the same. And ofc to restore the previous UUID from inside the partition editor (fdisk or gpt) or with tune2fs -U.

For future reference it's best to use parted instead, which will take care of everything for you. Best to boot into a GParted live stick for any operations on essential partitions, not to do it on the live system. Same thing for copying partitions, use a Clonezilla live stick. With Ventoy you can make a USB stick with several such tools on it, you just install Ventoy and then drop ISO files on the stick.

[–] [email protected] 1 points 9 months ago

Jep. I really would not recommend doing it that way, but when i saw that method i wanted to try it out. Had a full disc backup done before that anyway.

[–] [email protected] 1 points 9 months ago (2 children)

Wait you can cat an entire device to another like that? I’ve always been told to use dd

[–] [email protected] 1 points 9 months ago* (last edited 9 months ago)

You can, it will copy until it runs out of source or runs out of destination so it's very simple to use for stuff like this. Performance also tends to be very good because it chooses some good defaults for block size and so on, unlike dd where you have to choose by hand.

dd also has some issues that you have to be aware of such as the fact it will always fill full blocks by default. For example if you choose 1M blocks and your source is 1.5M it will write 2M. It's not a problem in a scenario like I described where the new disk is larger and empty and that extra 0.5M will go unnoticed, but if you had some other partition past the 1.5M mark it may potentially mess it up. You have to use a flag to make it write exactly what it reads ("fullblock" I think – yeah that's intuitive; unless they changed it and now it's reversed by default? I don't even know).

So yeah overall dd is more trouble than it's worth unless you're prepared and need to control the copy super-exactly.

[–] [email protected] 1 points 9 months ago

You can even use cp of I recall correctly, dd allows to tune some parameters but it's not strictly necessary.

[–] [email protected] 1 points 9 months ago (1 children)

what file system are you using?

[–] [email protected] 1 points 9 months ago (1 children)
[–] [email protected] 2 points 9 months ago (1 children)
[–] [email protected] 2 points 9 months ago

That's really cool, I didn't realize this was even possible.

[–] spittingimage 1 points 9 months ago

I did something similar. I loaded an older version of Mint off a live CD to use GPartEd to resize them. It worked like a charm, no problems.

[–] [email protected] 1 points 9 months ago* (last edited 9 months ago) (1 children)

resize2fs and lvreduce? I mean if you have used LVM... It's not easy, but doable without a reinstall. Yeah. the guides also tell people to make a backup first.

[–] [email protected] 2 points 9 months ago

yeah, that's been my conclusion as well. ripping off a bandaid that may break bad.