You are not logged in.

#1 2018-01-03 12:17:04

deathholes
Member
Registered: 2015-07-30
Posts: 21

Moving Existing Installation to a different partition

Hi,
I have an existing arch installation in a 30gb partition (only / , /home is mounted on a different partition). Lately I'm facing issue with low disk space on  /. I have tried removing pacman cache and deleting journald logs. It works but the space fills up again frequently. I need a permanent solution for this. I looked on my existing partition and found I have given 100 GB to a windows installation which i don't use anymore. So, I'm thinking of moving / to this new partition.
The first thing that comes to my mind is  boot up the system using a live usb and use 'dd' to copy all the stuff to the new partition and make necessary changes in the fstab and grub entries.
Just wanted to know if that's a good idea and/or if anybody has a better idea.

P.S. I don't want to install a new arch system again. This system has all the things  properly set up and configured.

Thanks

Offline

#2 2018-01-03 12:37:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Moving Existing Installation to a different partition

deathholes wrote:

but the space fills up again frequently. I need a permanent solution for this.

If a bucket keeps overflowing even after you dump it out, then getting a bigger bucket will not be a permanent solution: it will just prolong the time between dumps.  A permanent solution is to patch the hole in the roof so the bucket stops filling up!

What is filling your root partition?  Do you have a journal/logs that are growing out of control?  If so that's a symptom of a real problem, don't try to ignore it.  I can't think of other causes off hand, but any other cause would also likely be just a symptom that you should diagnose the cause of, not just prolong.

But if you do opt for moving your root partition, dd will not help as you'd just move a 30G filesystem, and you'd still be capped at 30G.  Rsync would be better.

Last edited by Trilby (2018-01-03 12:38:39)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-01-03 13:09:50

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Moving Existing Installation to a different partition

deathholes wrote:

P.S. I don't want to install a new arch system again. This system has all the things  properly set up and configured.

As an FYI (and if I'm not horribly mistaken), unless you've been tinkering under the hood, all config files for the system reside in /etc some place, and in your local home folder. If you back these up and reinstall, you can just pull your config files back and things will be just as they were.

For example, I commit all my user config files to a Git repository and keep them up to date there. When I build another machine or get a new machine, etc., I just pull the files from my Git repo, put them back in their place and all my settings for various tools, WMs, etc. are back in place.


Matt

"It is very difficult to educate the educated."

Offline

#4 2018-01-03 13:45:23

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: Moving Existing Installation to a different partition

+1 for finding out why the disk space is filling up first. Use "ncdu" to see what's taking up space in your root partition. As Trilby suggests, check your logs and journal.

And also +1 for using rsync instead of dd to move if you decide that's what you want to do. I have done this several times to move systems to new hardware of different partitions. https://wiki.archlinux.org/index.php/Rs … tem_backup


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#5 2018-01-03 13:51:28

deathholes
Member
Registered: 2015-07-30
Posts: 21

Re: Moving Existing Installation to a different partition

Trilby wrote:

If a bucket keeps overflowing even after you dump it out, then getting a bigger bucket will not be a permanent solution: it will just prolong the time between dumps.  A permanent solution is to patch the hole in the roof so the bucket stops filling up!

What is filling your root partition?  Do you have a journal/logs that are growing out of control?  If so that's a symptom of a real problem, don't try to ignore it.  I can't think of other causes off hand, but any other cause would also likely be just a symptom that you should diagnose the cause of, not just prolong.

Actually I had underestimated the required size for '/' partition. After installing so many packages, the free space of / partition hangs around 1-2 GB. I saw that I already have a 100 gb partition so why not use it?  Maybe 100 GB is too much (60 GB would work for me i think)

Trilby wrote:

But if you do opt for moving your root partition, dd will not help as you'd just move a 30G filesystem, and you'd still be capped at 30G.  Rsync would be better.

Why will it be capped to 30G?

for rsync, you mean something similar to this ?

https://help.ubuntu.com/community/Parti … ome/Moving

mrunion wrote:

  As an FYI (and if I'm not horribly mistaken), unless you've been tinkering under the hood, all config files for the system reside in /etc some place, and in your local home folder. If you back these up and reinstall, you can just pull your config files back and things will be just as they were.

It is true, but i have to install so many packages again and it takes a subtantial time to do that. I wanted a simpler solution like just moving it to new partition.

mrunion wrote:

  For example, I commit all my user config files to a Git repository and keep them up to date there. When I build another machine or get a new machine, etc., I just pull the files from my Git repo, put them back in their place and all my settings for various tools, WMs, etc. are back in place.

Can I get a link for that to get an idea of which files to backup for this.

Offline

#6 2018-01-03 14:32:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Moving Existing Installation to a different partition

deathholes wrote:

Why will it be capped to 30G?

That's the size of the filesystem.  If you use dd, it moves the entire filesystem.  I suppose you could use dd then use another tool to resize the filesystem.  But this is the worst of all options for several reasons.  First, dd is slower the rsync as dd has to move every bit, even irrelevant bits; rsync moves files.  Also, file size resizing tools can be trouble - in many cases you'd be just fine, but I'd never resize a filesystem with any data on it that I couldn't afford to lose.  Finally, dd itself is completely unforgiving: if you get 1 parameter wrong you end up destroying all your data rather than moving it.  Other tools can damage data if used incorrectly, but dd is the least likely to warn you about common errors, and least likely to leave anything behind to be recovered.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2018-01-03 14:42:45

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: Moving Existing Installation to a different partition

It is true, but i have to install so many packages again and it takes a subtantial time to do that. I wanted a simpler solution like just moving it to new partition.

If i remember well you can copy your /var/cache/pacman/pkg (of course if you have 1 package for each program in cache) and then just run

pacman -U /your/pacman/cache/directory/*

.

I was interested in doing this some time ago, but as you will see is always discouraged to copy a whole partition from one point to another.

[edited for some rewriting]

Last edited by lo1 (2018-01-03 14:45:29)

Offline

#8 2018-01-03 14:46:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Moving Existing Installation to a different partition

lo1 wrote:

... always discouraged to copy a whole partition from one point to another.

I wouldn't discourage moving the content of one partition to another.  If a move to a larger filesystem is warranted (still an open question in my mind*) then reinstalling or copying all the contents are each perfectly reasonable alternatives.

*note: 30G is quite large for a root partition in arch.  It's certainly possible to use more, but in such cases the user would know exactly why they are using so much space: they'd probably have *many* large full DEs installed, and several individually enormous packages like some games (wesnoth or 0ad), ghc-static, cuda packages, etc.

Last edited by Trilby (2018-01-03 14:54:18)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2018-01-03 16:09:03

TheSgtBilko
Member
Registered: 2013-08-13
Posts: 87

Re: Moving Existing Installation to a different partition

Maybe look into cleaning up your package cache (https://wiki.archlinux.org/index.php/Pa … kage_cache)

Offline

#10 2018-01-03 17:53:04

deathholes
Member
Registered: 2015-07-30
Posts: 21

Re: Moving Existing Installation to a different partition

Trilby wrote:

*note: 30G is quite large for a root partition in arch.  It's certainly possible to use more, but in such cases the user would know exactly why they are using so much space: they'd probably have *many* large full DEs installed, and several individually enormous packages like some games (wesnoth or 0ad), ghc-static, cuda packages, etc.

Actually that is my work system and I tend to install a lot of packages over time. I use KDE as my only DE. I use some big packages for work like intel compiler toolchain. I use a 40G partition for my '/' partition in my laptop and that works fine and I don't have any issues with it. The main problem is that I underestimated the size required and realized it pretty late.

I will try the rsync cloning tomorrow and post the results.
Any other thing to keep in mind apart from changing the fstab file and reconfiguring grub-config?

TheSgtBilko wrote:

Maybe look into cleaning up your package cache (https://wiki.archlinux.org/index.php/Pa … kage_cache)

I already do that on a regular basis and actually have to remove all the packages from the folder although that is not a good practice.

Offline

#11 2018-01-04 16:07:37

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Moving Existing Installation to a different partition

deathholes wrote:

Can I get a link for that to get an idea of which files to backup for this.

My configs are in a private repository, so I'll pass on opening that up. Also, different applications store settings in different files, so knowing what file is used to store config settings is application dependent. With that said, here are some pointers you can use as a guide:

~/.vimrc
~/.Xresources
~/.xinitrc
~/.configs/openbox/{autostart,environment,rc.xml,menu.xml}
~/.gnupg

/etc/pacman.d/mirrorlist

What I do is copy these config files to a backup folder that has sub-folders for each of my machines. I then commit the backup folder to a Git repository. Any time I make a change to a config, I copy it over to the backup folder and commit it and push it up to the repository. this way I can get a copy of the configs from all my machines in one place. Since it's a Git repository, they are also versioned for me, so I can see past history on what I;ve changed or may need to revert to.

There is also a Dot Files backup script/program floating around here somewhere. that may be helpful as well.

Last edited by mrunion (2018-01-04 16:09:58)


Matt

"It is very difficult to educate the educated."

Offline

#12 2018-01-05 00:07:55

papavlos
Member
Registered: 2017-09-23
Posts: 67

Re: Moving Existing Installation to a different partition

For such cases I always keep an usb stick with actual gparted live system.
So I would simply delete the unused windows partition and expand the existing root partition of your arch system to the desired size.

It would also be wise to make a backup of your current root partition prior any manipulation with gparted.

But, the question why you're running out of 30 GB just for your root partition is still actual.

Offline

#13 2018-01-05 09:25:56

deathholes
Member
Registered: 2015-07-30
Posts: 21

Re: Moving Existing Installation to a different partition

I tried moving the '/' partition and was successful to move it to a new partition.

I just used the rsync command to copy all the stuff to the new one and made changes to grub (using grub-mkconfig).

Regarding the repeated question of why I'm running out of 30 GB in my root partition.
I use this machine for my work and I'm student by the way. So, I tend to install numerous packages (different versions also) for trying out tools / softwares etc. I don't like to remove packages because I may need it later.

/usr : 15 GB
/opt : 3.5 GB
/var : 2.5 GB

This is roughly the size taken by each folder.
This is after I cleaned up the systemd logs and pacman cache.

The total sum is around 21 GB now but 'df -h' shows it as 28 GB. Anyone has any idea why so much discrepancy between the sizes?

EDIT:
On further checking I found that I have multiple docker images installed which takes upto 8 GB space.

Last edited by deathholes (2018-01-06 08:20:19)

Offline

Board footer

Powered by FluxBB