You are not logged in.

#1 2018-09-22 19:28:11

leave
Member
Registered: 2018-09-14
Posts: 16

How to fix fstab while keeping /home data

So I recently installed Arch a few weeks ago and am now happy with my setup. However, I noticed recently that my 256GB storage drive was apparently 50% full... and I realized after doing some investigation that my separate /home partition was not mounted.

The issue appears to be in the fstab which does not have my /home in it at all. So the ideal thing to do would be to liveboot into something and add the UUID to the fstab, howeover I already have a lot of stuff in my /home I'd like to keep and I'm worried that it will all get deleted. Any way to fix this without losing everything?

P.S. I set up LVM inside of a LUKS encryption thing by the way

Offline

#2 2018-09-22 19:43:55

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: How to fix fstab while keeping /home data

If you mount home somewhere else temporarily such as /mnt does it contain any user directories that would need merging?

Offline

#3 2018-09-22 19:51:20

leave
Member
Registered: 2018-09-14
Posts: 16

Re: How to fix fstab while keeping /home data

Ummm not sure what you mean but as far as I can tell the partition which was intended to be /home appears to be blank other than this one directory named lost+found

Last edited by leave (2018-09-22 19:51:34)

Offline

#4 2018-09-22 19:53:58

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: How to fix fstab while keeping /home data

Either use live media or make sure all none root users are logged out then

# mv /home/* /mnt

then add the fstab entry for /home and if you want to keep using that boot unmount /mnt then mount /home/
Edit:
What I was checking for was if you had for instance /home/leave and /mnt/leave the the contents of those two directories would somehow have to be merged.

Last edited by loqs (2018-09-22 19:58:17)

Offline

#5 2018-09-22 20:33:16

leave
Member
Registered: 2018-09-14
Posts: 16

Re: How to fix fstab while keeping /home data

Removing /etc/fstab and then running genfstab again worked for me. lsblk now shows that my home partition is mounted. Thanks!

(funny thing, the filesystem plugin in polybar still shows 55% usage on my disk hmm)

Offline

#6 2018-09-22 20:44:45

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: How to fix fstab while keeping /home data

Did you move the contents from the home directory before changing the mount?  How much space did you expect moving the home directories to free?

Offline

#7 2018-09-22 22:27:32

leave
Member
Registered: 2018-09-14
Posts: 16

Re: How to fix fstab while keeping /home data

Not quite sure what you mean. I mounted first the home partition on /mnt while booted into my archlinux installation. I then copied everything with cp -r and then booted into a live Arch ISO, then I mounted everything and removed /mnt/home and then did genfstab again.

Also, the root partition was 45GB meaning I should have used up around 23GB for it to be at 55% usage... and my home partition is 181GB. Maybe it's just because my home directory was small compared to all my other files or something.

Offline

#8 2018-09-22 23:18:22

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

Re: How to fix fstab while keeping /home data

leave wrote:

I then copied everything with cp -r ...

There's the problem.  You were advised to move not copy.  Now you have two copies of everything that was under /home/ each taking up space.  But the copy you want to get rid of is masked but the second partion being mounted over it, so you cannot just delete it (from your running system).

Boot a live system, mount your root partition (and only your root partition), then delete everything under /home on the root partition.  Then you should be set.

EDIT: I suppose you could do this from your current system if you just log out all non-root users, log in as root, unmount your new home partition, then delete everything under /home/ (stuff that is on the root partition).  Doing it from a live system just feels safer to me as there fewer things that could go wrong resulting in undesirable outcomes.

Last edited by Trilby (2018-09-22 23:53:51)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2018-09-22 23:32:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: How to fix fstab while keeping /home data

Trilby wrote:

I suppose you could do this from your current system if you just log out all non-root users, log in as root, unmount your new home partition...

Use `lsof` to identify and then kill any remaining services/process running after you log out, otherwise you won't be able to unmount /home.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2018-09-23 00:57:03

leave
Member
Registered: 2018-09-14
Posts: 16

Re: How to fix fstab while keeping /home data

I did rm -rf /mnt/home before mounting the /home partition, sorry if it was unclear

Offline

#11 2018-09-23 01:05:45

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

Re: How to fix fstab while keeping /home data

(deleted previous content)

Wait, you did `rm -rf /mnt/home`?  So you deleted all the stuff you copied over to the new partition, but you didn't delete what was on the root partition.  So there's no surprise the space on your root partition is still used.

Slow down, think through what you are doing, and if you aren't equiped to think through these steps, you probably shouldn't be using arch linux.

Last edited by Trilby (2018-09-23 01:10:17)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#12 2018-09-23 01:18:01

leave
Member
Registered: 2018-09-14
Posts: 16

Re: How to fix fstab while keeping /home data

What?
I mounted my home partition at /media/home.
Also it appears that my disk space is being used because I forgot to delete my backup of /home...

Last edited by leave (2018-09-23 01:22:28)

Offline

#13 2018-09-23 01:43:13

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to fix fstab while keeping /home data

leave wrote:

What?

What?

...

The problem here is that you are being extremely unclear what you actually did. Please provide a step-by-step explanation of every step you took, in order, since at this point all we know is that you did "something".

Last edited by eschwartz (2018-09-23 01:44:07)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#14 2018-09-23 02:09:56

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

Re: How to fix fstab while keeping /home data

leave wrote:

I mounted my home partition at /media/home.

And do you realize this is the first time you made any note of this at all in this thread?  Perhaps I was wrong and you are fully capable of handling this situation well.  And perhaps all is indeed well now.  But if you need help on these forums you need to tell us what you are doing - we certainly can't provide advice based on an ability to know things you have done that you've not mentioned.

Last edited by Trilby (2018-09-23 02:10:13)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2018-09-23 07:06:53

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,840

Re: How to fix fstab while keeping /home data

Here's a very kind advise: backup your $HOME to some external drive before you continue…

Offline

Board footer

Powered by FluxBB