You are not logged in.

#1 2017-03-27 17:23:50

micman
Member
Registered: 2016-08-10
Posts: 16

Adding a new partition to an existing system [SOLVED]

Hello!

I have encountered a problem trying to add a new partiiton to Arch Linux. On my hard disk I have 30 GB for this OS and the 9/10 are used. I wanted to move my /usr directory (11 GB) to an other ext4 partition on my hard disk (30 GB). But at the booot  the result is this:

"Error: Root device mounted successfully, but /sbin/init does not exist.
...
sh: can't access tty: job control turned off."

I have followed the instructions of this article: https://wiki.archlinux.org/index.php/ad … ing_system.

What to do?

Last edited by micman (2017-04-04 12:01:08)

Offline

#2 2017-03-27 17:28:26

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

Re: Adding a new partition to an existing system [SOLVED]

wiki wrote:

Warning: Directories essential for booting (except for /boot) must be on the same partition as / or mounted in early userspace by the initramfs. These essential directories are: /etc and /usr [1].

Why would you want to move /usr?  That should be the only thing in the root partition that takes up any noteworthy space - do you not already have a separate /home partition?  That should be the first thing split off.

What is your current/old partitioning scheme?  What is taking up 19GB?


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

Offline

#3 2017-03-27 17:29:23

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Adding a new partition to an existing system [SOLVED]

You need to make some modifications to have /usr on a seperate partition...
https://wiki.archlinux.org/index.php/Mk … _partition

Edit - But answer Trilbys questions first, there should be no need for a seperate /usr.

Last edited by Slithery (2017-03-27 17:30:38)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2017-03-28 02:00:35

micman
Member
Registered: 2016-08-10
Posts: 16

Re: Adding a new partition to an existing system [SOLVED]

Thanks for your answers. I think that I have understood the problem.
For Trilby. I haven't a separated /home partition because I don't use it very much, hence it's very little. The reason is that I have a partiton outside of the Arch Linux filesystem –ntfs formatted– that I use for my docs sharing them between Arch, Windows and an other Linux distro. Therefore, at present my partionning scheme is very simple: I have only one partition for Arch, and up to now I hadn't problem for this. The reason to move /usr is that this last is a very "heavy" directory in my filesystem (11 GB on 30 GB).
I'll try the slithery suggestion and I'll answer you about the result. I have made a backup of Arch and /usr and I think that I'll be able to restore one or the other in case of trouble.

Offline

#5 2017-03-28 10:31:19

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Adding a new partition to an existing system [SOLVED]

If you have space issues then you are better off putting /home somewhere else, /usr will be fairly static in size, $HOME tend to grow to avaliable space + ∞


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2017-03-28 12:18:01

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

Re: Adding a new partition to an existing system [SOLVED]

You skipped the second half of my question.  /usr can be moved, but that should really be a very last resort.

Also, /usr being ~11GB sounds perfectly normal to me.  But generally there wouldn't be anything else other than /usr and /home that should take up any noteworthy amount of space.  If /usr is 11GB and your filesystem has 30GB total that are being used up and you claim it's not from /home, then what is eating the other 19GB?

Do you have logs that are growing out of control indicating a problem you are ignoring?  Or do you have a lot of manually installed stuff under /opt?

In the case of the former, identify the problem and clean out the logs.  If it's the latter, then /opt can *very* easily be put on a separate partition.  This would be much preferable to moving /usr

Other than bloated logs or software under /opt I can't think of anything outside of /home and /usr that could take up any noteworthy amount of space, certainly not 19GB.


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

Offline

#7 2017-03-28 17:54:38

micman
Member
Registered: 2016-08-10
Posts: 16

Re: Adding a new partition to an existing system [SOLVED]

Trilby wrote:

You skipped the second half of my question.

Yes, because I haven't realized its signification.

/usr 11 GB
/opt 750 MB
/home 550 MB
but…
/var 5.63 GB
whose
/var/log 2.73 GB
/var/cache 2.71 GB

Periodically I clean pacman cache (/var/cache/pacman/pkg/) with # pacman -Sc. This deletes only the versions of the packages that are not currently installed. Hence, to free a noteworthy space in my partition (>5 GB), I must remove at least /var/log and all the packages in the pacman cache or move /usr. Can I remove them without problems ?

«It is possible to empty the cache folder fully with pacman -Scc … this also prevents from reinstalling a package directly from the cache folder in case of need, thus requiring a new download. It should be avoided unless there is an immediate need for disk space.» (<https://wiki.archlinux.org/index.php/pacman>.)

Offline

#8 2017-03-28 18:19:40

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

Re: Adding a new partition to an existing system [SOLVED]

You can remove old versions of installed packages preserving a given number of older versions of each package.  For example, I regularly do the following:

paccache -ruk0
paccache -rk1

This removes all cached packages that are no longer installed, and all old cached packages of installed packages except for the currently installed version.  -rk2 would be safer to keep one downgradable version (other than the current one) of each installed package, but I only do this when it seems all installed packages are working well.  Then I'll still have these packages cached if a future update breaks something.

That could save some space, but I'd  be *much* more concerned about what's happening under /var/log - something is eating a lot of space there - this is likely indicative of a problem you should identify, not just buy more space for.

But even with these, that's just ~18Gb.  Are you really worried about filling up the 30?  As Mr E. suggested, once you've installed and customized your system, the size of /usr will not change substantially.  So I'm not sure why you feel you need to move anything.


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

Offline

#9 2017-03-28 23:25:44

micman
Member
Registered: 2016-08-10
Posts: 16

Re: Adding a new partition to an existing system [SOLVED]

The big size of /var/log is caused by \var\log\journal\ (2.46 GB), where the system logs are stored. The problem and its solution are discussed here: https://bbs.archlinux.org/viewtopic.php?id=158510

Mr.Elendig wrote:

/usr will be fairly static in size.

This was un unknown thing for me. I supposed that with the updates and the installation of any new packages this directory would be growing all the time. Hence, the little free space on my system partition is actually a problem less important than I thought.

Offline

#10 2017-03-29 08:48:29

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Adding a new partition to an existing system [SOLVED]

micman wrote:
Mr.Elendig wrote:

/usr will be fairly static in size.

This was un unknown thing for me. I supposed that with the updates and the installation of any new packages this directory would be growing all the time. Hence, the little free space on my system partition is actually a problem less important than I thought.

And how often do you install new packages of a significant size? And do you never uninstall anything?
As for updates:

Net Upgrade Size: -2,58 MiB

or similar is not uncommon to see.

And even if /usr doubled in space you would still have enough left for a functional system if you just keep the user data somewhere else than /


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#11 2017-03-30 17:12:50

micman
Member
Registered: 2016-08-10
Posts: 16

Re: Adding a new partition to an existing system [SOLVED]

I have not installed any package of significant size after the period I installed Arch Linux about a year ago and the "packet" of softwares that I use regularly. In general, I don't uninstall any software if I haven't a problem, for instance a dependency problem. My user data directory (/home) doesn't cause a real problem of space, because I already have my most important personal data stored in a special partition outside of the system partition.
Now, that I have restablished /usr in its original partition (/), cleaned up the old log files --by following the instruction that I found at this adress: http://unix.stackexchange.com/questions … journalctl-- and the oldest packages from the pacman cache, I have freed 2.5 GB, and the used space of my system partition fell from 91% to 82%. It's a good result.
I could create a new space by enlarging the system partition, because I have created a free space in my SSD after that I deleted an old unused partition. This last was near the Arch partition. I could use parted or gparted to make this, but I am not sure that such operation can be made without relevant risks. Any advice in this regard?

Offline

#12 2017-03-30 18:07:25

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

Re: Adding a new partition to an existing system [SOLVED]

First, you shrunk your logs, but you seemed to ignore me repeatedly saying you shouldn't be ignoring what is filling up your logs.  Oh well.  You likely have a problem you don't know about, and now it will be hard to know about.  But it's your system.

More directly on the topic of this thread, your numbers really don't add up.  You gave numbers in post #7 that add up to 17.93GB on a 30GB partition.  Now you've trimmed your cache and logs removing another 2.5GB, which should mean you are now using 15.43GB on a 30GB partition.  Yet you say this is 82%.  Where does this 82% number come from?


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

Offline

#13 2017-03-31 02:50:37

micman
Member
Registered: 2016-08-10
Posts: 16

Re: Adding a new partition to an existing system [SOLVED]

There was an error in my calculation, but the situation is better:

/usr + /opt + /home + /var = 15.43 GB
+
/boot 0.430
/dev 0.010
/etc 0.030
/lost+found ~0.000
/media 0.040
/mnt 0.004
/$RECYCLE.BIN 0.000
/root 5.400
/run 0.050
/srv 0.008
/sys 0.628
/System Volume Information ~0.000
/tmp ~0.000
/.Trash-0 ~0.000
= 6.600 GB
+
/proc 140.7 TB 
Excluding /proc, the total of 15.43 + 6.60 = 22.030.
22.030 x 100 / 30 = 73.43%

To anticipate the question, my /root directory is so "heavy" because I log in as root against any security advice. I make this because in fiftheen years that I use Linux as a secondary OS and almost a year as principal OS, I never had any problem. I don't recommend anyone to try it.  Simply, I make it at my own risk. In the /root directory many gigabytes are allocated to Wine, because I still need some Windows softwares. Hence, for my needs it is not a waste of space, but a necessity.

Regarding the number and the size of the journal logs, I supposed that the cause was a bad configuration of /etc/systemd/journald.conf (see the link above). I have changed 'Resetting SystemMaxUse=' to 'Resetting SystemMaxUse=200M'. This didn't change anything in /var/log/journal. Consenquentely, I have cleaned it using the --vacuum options:
journalctl --vacuum-size=200M
journalctl --vacuum-time=5d
I don't know if this method will be functional in the long term. For now the size of the directory "take up 32.0M in the file system".

Last edited by micman (2017-03-31 08:27:02)

Offline

#14 2017-03-31 10:44:27

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

Re: Adding a new partition to an existing system [SOLVED]

So we're 13 posts in and you've now finally answered my question from post #2 (I think) despite the fact that you've previously given misleading answers to that same question several times (which is why I only think you've answered it now ... I really can't be sure).  It seems up to this point you've been deliberately hiding the fact that /root is over 5GB, potentially to hide the fact that you run as root.  I really coudn't care less whether you run as root.  I do care if you waste my time by feeding false information and/or half truths when I'm trying to gather information to help you.

So in summary you ignore sound advice to not run as root - that's certainly your choice.  But you also ignore my advice to identify what is bloating your log.  Your claims that running as root doesn't cause any problems don't carry much weight as there is a huge blinking neon sign saying there is a problem, and you just decided to ignore it.

You seem to be committed to doing things your own way against the advice of others.  That is entirely up to you - but if that's your strategy, don't bother asking for advice here as it's a waste of everyone's time and goodwill.


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

Offline

#15 2017-04-04 11:58:06

micman
Member
Registered: 2016-08-10
Posts: 16

Re: Adding a new partition to an existing system [SOLVED]

Trilby wrote:

It seems up to this point you've been deliberately hiding the fact that /root is over 5GB, potentially to hide the fact that you run as root.

Are you serious? You are serious, but you doubt that your interpretation is correct because previously you have said:

Trilby wrote:

I really can't be sure

You have reason to doubt because your interpretation is false.

You have considered me like a little child caught with his hand in the cookie jar which can’t hide his shame. Take my word for it, it is longtime that I am not anymore.

It’s true that my reponses were partial, but only because I was partly confused and I proceeded hesitating step by step. It is not a case that I post to ask help in a newbie forum and not in a forum for developers. This fact cannot justify everything, but it is implying many limits.

If I wasted your time, I apologize for it, but you haven’t the right to speak for others like you have done:

Trilby wrote:

You seem to be committed to doing things your own way against the advice of others. That is entirely up to you - but if that's your strategy, don't bother asking for advice here as it's a waste of everyone's time and goodwill.

In others terms I am a Help Vampire with the opposite aptitude of the indolent ones!

"It [Arch Linux] is targeted at the proficient GNU/Linux user, or anyone with a do-it-yourself attitude who is willing to read the documentation, and solve their own problems." https://wiki.archlinux.org/index.php/Arch_Linux

"The Code of Conduct here has been developed over a number of years and reflects the community's ethos of a functional support system with a high signal-to-noise ratio and an explicit expectation of self-sufficiency and willingness to learn." https://wiki.archlinux.org/index.php/Code_of_conduct


I SOLVED MY PROBLEM listening your advices and those of others who have answered the same question, and I accomplished it reading documentation. So I found and followed different paths to understand and learn. First, I discarded my original idea to move /usr outside of /, I purged /var/cache/pacman/pkg and /var/log/journal and I modified /etc/systemd/journald.conf. Afterwards, I enlarged my system partition using the free space of an old unused partition creating a greater one. To do this I used a recently dd backup of my system. All went well, apart the fact that the swap partition wasn’t recognized and the free space partition was limited by the limits of the dd backup (= the limits of the old partition). Consequently, I corrected the first problem changing the swap partition UUID in /etc/fstab with the new one that I found with Gparted. Finally, I still used this one to enlarge (resize2fs) the Arch Linux partition. At this moment my system works well.

Offline

#16 2017-04-04 18:25:25

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: Adding a new partition to an existing system [SOLVED]

Trilby is a great contributor in these forums. I can understand his frustration. The XY problem is a situation that occurs pretty often here. If you ask for help, remember that these guys use their spare time to guide people through their computer issues. To provide them with the information they ask for is not only a polite gesture, but also essential for finding out what the problem actually is. When providing information you should provide all information, not only what you believe is relevant:

Sources of information
Full output of any command involved - don't just select what you think is relevant.

(source)

Don't get me wrong. I understand your frustration also. But the people who are trying to guide and help you are often seeing thing from a different perspective. You may think Trilby was hard on you in his last post. But think about it. If you did provide him with what he asked for early in this thread, this subject could have been solved in a few posts.

But anyway: I am glad you've got your issue resolved.

Edit:
Even though your issue got solved you should really look into what Trilby said about your logs:

Trilby wrote:

, but I'd  be *much* more concerned about what's happening under /var/log - something is eating a lot of space there - this is likely indicative of a problem you should identify, not just buy more space for.

Running your system entirely as root, as already mentioned, is not recommended from a security perspective. If you choose to do so, it's your choice. But remember that even a harmful bug in a program can do pretty serious damage when having root privileges.

Last edited by olegabrielz (2017-04-04 20:08:32)


Be aware of my Newbie Powers

Offline

#17 2017-04-04 22:34:14

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: Adding a new partition to an existing system [SOLVED]

micman wrote:

At this moment my system works well.

Trilby's point though was that if you want to seek the help of the wider Arch community then answer the questions as they are given.  Not doing so wastes time and energy and in the end only makes your problem more difficult to solve.  And who does that hinder in the end?  You.

Offline

#18 2017-04-06 13:18:51

micman
Member
Registered: 2016-08-10
Posts: 16

Re: Adding a new partition to an existing system [SOLVED]

OK. It’s clear.
To seek – and also to give – help there is a methodology, and it’s necessary to follow this last. But it’s also necessary to explain the error and his cause(s) when it happens, at least the first time, and it was my case.
Thank you for the explications, particularly to olegabrielz for the link.

Offline

Board footer

Powered by FluxBB