You are not logged in.

#1 2014-03-26 19:28:52

tpoisot
Member
From: Canada
Registered: 2013-07-01
Posts: 8
Website

[solved] Wrong /etc/fstab, services won't start

I re-installed my laptop last week, and being slightly sleep deprived due to a very young baby, I made a mistake with /etc/fstab

Specifically, I allocated a 20G partition for /var, but it's in the /etc/fstab as /home

Here is the output of lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 119,2G  0 disk 
├─sda1   8:1    0    15G  0 part /
├─sda2   8:2    0    20G  0 part 
├─sda3   8:3    0     1G  0 part /boot
└─sda4   8:4    0  83,2G  0 part /home

My /etc/fstab is

# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
# /dev/sda1
UUID=d408dcf3-657b-4216-a5d6-b5d2edbb60fe	/         	ext4      	rw,relatime,data=ordered	0 1

# /dev/sda4
UUID=ad0011ff-bbf8-4275-9ace-43e8c02dcec7	/home     	ext4      	rw,relatime,data=ordered	0 2

# /dev/sda2
UUID=a3a88964-c53a-498e-b079-a9d7752142cc	/home     	ext4      	rw,relatime,data=ordered	0 2

# /dev/sda3
UUID=EF36-0E07      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro	0 2

Now, obviously, /sda2 should be mounted at /var. If I edit the /etc/fstab, the laptop boots fine, but I can't run any services (so no login manager, no network manager, or anything). Short of a complete reinstall, is there something I can do to fix it?

Last edited by tpoisot (2014-03-26 23:55:58)

Offline

#2 2014-03-26 21:04:21

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved] Wrong /etc/fstab, services won't start

I don't know what happens when you mount two devices in the same place. I guess the last one mounted would take precedence, in which case sda4 may be empty. My guess is you will need to move the contents of sda2 to sda4, then move the contents of /var (on sda1) to sda2. Be sure to preserve ownership etc. Then fix the fstab. You may be able to do all this from the recovery console.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2014-03-26 22:29:05

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,375

Re: [solved] Wrong /etc/fstab, services won't start

Time to pull out the rescue live CD and fix the /etc/fstab mounting the partitions in their own separate mounts to see which one is which.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#4 2014-03-26 23:55:36

tpoisot
Member
From: Canada
Registered: 2013-07-01
Posts: 8
Website

Re: [solved] Wrong /etc/fstab, services won't start

Actually, as the /dev/sda4 was mounted as /home, it was fairly easy to repair. I just copied /var/* into a temp folder, edited /ect/fstab, then logged as root, removed the content of /var (now on /dev/sda2), and copied the content of the temp folder back. Rebooted, and all works well.

(I guess I've been very lucky...)

Offline

Board footer

Powered by FluxBB