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

Re: moving /var



Hello,

On 01/03/13 12:06, Joao Luis Meloni Assirati wrote:
Hello List,

On 01/03/13 09:53, Lars Noodén wrote:
On 3/1/13 10:41 AM, Maroš Žilka wrote:
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 ?

I wouldn't do it on a running system.  Better to boot from a live CD or
similar and do it from there.

A simple live CD is sufficient:
Debian netinst minimal CD in rescue mode is sufficient to do so.
Do not forget to update the /etc/fstab configuration file with respect
to the change; to clean up the /var (and let an empty one) in the `/'
(root) partition.

It is simpler to move the partition in single user mode. Just issue the
command (as root)

Indeed. I will think about it next time.



# shutdown now

(not 'shutdown -h now' or 'shutdown -r now'), wait the system go down and
enter the root password when asked. You will have just a root shell
running. An even more secure way (in case single user leaves some program
running) is to reboot and pass the argument

init=/bin/sh

to the kernel by editing the kernel command line in grub. You will start a
system with only a running shell as pid 1 and the root mounted read-only.
Then remount the root read-write:

# mount -o remount,rw /

and do the dirty work. When you finish, unmount all partition other than
the root, remount the root read only with

# mount -o remount,ro /

and reset the computer (shutdown will do nothing).

João Luis.




Reply to: