[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

moving /var



Hi,

I read in book about Linux file systems and at the end of chapter
there was one example in which author wanted to create dedicated
volume for /var coz it was mounted on root partition. Lets skip some
steps and assume we have prepared partition on disk - /dev/sdb1so he
did it this way:

[root@server ~]# mkdir /new_var
[root@server ~]# mount /dev/sdb1 /new_var
[root@server ~]# cp -vrp /var/* /new_var/
[root@server ~]# mv /var /old_var
[root@server ~]# mkdir /var
[root@server ~]# mount --bind /new_var/ /var

and what is really bothering me most is that cp command, wouldn't it
possibly create inconsistency ? What would be better way to do it ? Is
it even possible to do such change on running system without worries
to lose some data ?

Thanks.


Reply to: