You are not logged in.

#1 2012-11-04 07:41:50

kungsu
Member
From: Bangalore, India
Registered: 2011-07-21
Posts: 21

[SOLVED] Problem in moving /var to new partition

Hi,
I setup a new systemd Arch instalation on an SSD and migrated successfully from my old initscripts based HDD setup. I have 2 problems now, one leading to another.

I wanted to move /var to a partition on HDD and followed the following steps.

  • Created a new reiserfs partition for var on my HDD using gparted. Labelled it as "var"

  • Rebooted to emergency mode and mounted it. (I remounted root as read-write)

     # mount /dev/sda8 /mnt/new_var
  • Copied var contents to new_var

     # cd /var
     # cp -Rax * /mnt/new_var/
     # cd /
     # mv var var.old
     # umount /mnt/new_var
     # mkdir var
     # mount /dev/sda8 /var
  • Added the following line to /etc/fstab

    LABEL=var 	/var 	reiserfs 	defaults	0 1

When I reboot after this, systemd is timing out waiting for a var partition. Here is an pic taken during boot.

I restored the old var using the emergency shell and could reboot properly. I tried the same thing as a normal user using sudo after the system was up. (During the moving, I got sudo warnings because the sudo folder in /var/db wasnt there.)

With the new var partition in place, I proceeded to install a few packages. But when I rebooted, I the same thing happened again and had to get into emergency shell and restore the old var.

However, after this, the packages which I installed in the interim are not available in pacman database.

So,
1. How can I move /var to a separate partition and still keep systemd happy?
2. Is there a way to rescan or rebuild the pacman database? Will syncing the 2 different var setups that I've solve the problem? If so, how can I sync them?

Last edited by kungsu (2012-11-04 14:54:25)


Arch Linux + Compiz Standalone

Offline

#2 2012-11-04 07:49:30

krest
Member
From: Athens, Greece
Registered: 2009-01-22
Posts: 10

Re: [SOLVED] Problem in moving /var to new partition

Maybe you should add reiserfs in the modules array in mkinitcpio.conf, then "sudo mkinitcpio -p linux" and reboot.

Offline

#3 2012-11-04 09:27:52

kungsu
Member
From: Bangalore, India
Registered: 2011-07-21
Posts: 21

Re: [SOLVED] Problem in moving /var to new partition

I tried it now, but I ended up with the same problem again.


Arch Linux + Compiz Standalone

Offline

#4 2012-11-04 09:34:54

krest
Member
From: Athens, Greece
Registered: 2009-01-22
Posts: 10

Re: [SOLVED] Problem in moving /var to new partition

kungsu wrote:

I tried it now, but I ended up with the same problem again.

The module is not called reiserfs, maybe it's reiser4.

Offline

#5 2012-11-04 09:54:07

kungsu
Member
From: Bangalore, India
Registered: 2011-07-21
Posts: 21

Re: [SOLVED] Problem in moving /var to new partition

Isn't Reiser4 supposed to be different from Reiserfs? According to the wiki, Reiser4 specifically requires a patched kernel. Is it the case with Reiserfs too? I did not think so.
Besides, in /etc/mkinitcpio.conf as example is stated to included "reiserfs" and not "reiser4". So, i think they both are different.

Last edited by kungsu (2012-11-04 10:29:37)


Arch Linux + Compiz Standalone

Offline

#6 2012-11-04 12:05:48

krest
Member
From: Athens, Greece
Registered: 2009-01-22
Posts: 10

Re: [SOLVED] Problem in moving /var to new partition

I don't know, I don't use it. To be sure it's not the filesystem, you could try with a ext4 /var partition to see if the problem insists.
I did exactly the same procedure as you just yesterday with no problems (installed an ssd, booted from the old disk as usual and rsynced to the new ssd,
the only difference is that when i had to move the /var to a new partiotion in the HDD, i didn't reboot but I did a telinit 1 and continued from there.

Offline

#7 2012-11-04 12:40:08

Awebb
Member
Registered: 2010-05-06
Posts: 4,431

Re: [SOLVED] Problem in moving /var to new partition

You should also remove a possible source of ambiguity by not labeling the partition "var" and by not using labels. Use a device path (/dev/sd...) or even better, the UUID.

Offline

#8 2012-11-04 14:53:53

kungsu
Member
From: Bangalore, India
Registered: 2011-07-21
Posts: 21

Re: [SOLVED] Problem in moving /var to new partition

krest and Awebb,
I followed both you suggestions. I did a telinit and synced and modified /etc/fstab to use UUID. var partition is mounted properly now.
Thank you for the tips.

PS :
Could you explain what was the problem with using LABELs? I use LABELs for mounting all other devices, including root. Is it a matter of using LABELs or this label name in particular. In either case, if you could shed some light on it, i'd be pleased to know.


Arch Linux + Compiz Standalone

Offline

#9 2012-11-04 15:07:03

krest
Member
From: Athens, Greece
Registered: 2009-01-22
Posts: 10

Re: [SOLVED] Problem in moving /var to new partition

My /var partition is also labeled "var" with no problem. I use UUIDs in the fstab though.

Offline

#10 2012-11-04 15:17:25

kungsu
Member
From: Bangalore, India
Registered: 2011-07-21
Posts: 21

Re: [SOLVED] Problem in moving /var to new partition

I changed my setup that way now.
But, what difference does it make to have the partition identified by LABEL than by UUID as long as there is no ambiguity? could it be a bug with systemd or reiserfs or anything else?


Arch Linux + Compiz Standalone

Offline

#11 2012-11-04 15:24:45

Awebb
Member
Registered: 2010-05-06
Posts: 4,431

Re: [SOLVED] Problem in moving /var to new partition

I'm thinking in collision propabilities here. How probably might the device node change? I have machines that keep doing this without a real reason. I'd prefer labels on such machines. Other machines don't - without a real reason as well. I'd prefer device node notation on such machines. Labels can be changed manually, new partitions can be added and USB sticks with labled partitions can be inserted. While the USB situation should not be a big deal, both, labels as well as device nodes can be subject to changes, collisions and other arbitrary events. The only thing that is unlikely to change (for no obvious reason), be altered by accident or made collide with another one, are UUIDs.

I would not say using lables is bad, it's just that if you already have an issue, why not rule that out? It seemed to have solved the issue, it can be as easy as playing safe sometimes. Furthermore, the reason why I recommended to change the label from "var" to something else, is how common "var" is. It is like using a keyword in a programming language as a variable name, it may or may not work, so why not make it a habbit of not using such meta-keywords at all?

EDIT: There is no particular reason, I suspect the lable isn't set correctly. Maybe there is a problem with the partition table - that's where I'd suspect the LABLE to be stored.

Or maybe you just did the whole by-label thing wrong.

"/dev/disk/by-label/var" instead of LABEL="var"…

Last edited by Awebb (2012-11-04 15:27:43)

Offline

#12 2012-11-04 16:02:27

kungsu
Member
From: Bangalore, India
Registered: 2011-07-21
Posts: 21

Re: [SOLVED] Problem in moving /var to new partition

I think the device nodes are assigned in the order that they are scanned/recognized. In my case the boot drive (SSD) is connected to the 2nd SATA channel on the motherboard and is recognized as sdb. The aux drive (HDD) is connected to 1st SATA channel on the mb and is recognized as sda.

I use a single PC and there is probably less than one in a million chance that LABEL conflict could occur.

I have mounted root using LABEL and it boots just fine.

LABEL=ArchSSD   /               ext4        defaults,discard                    0   1

However, my question still remains open. Since I've mounted even root using a LABEL, I'd be interested in knowing what was happening with var.


Arch Linux + Compiz Standalone

Offline

Board footer

Powered by FluxBB