Hi, I need to lvextend the size of an LVM2 volume that /var is on. Obviously I need to unmount /var first, so I dropped to single user shell. Alas, some OS programs are accessing /var in single-user mode preventing me to umount it, according to fuser -vm /var. Killing them solves nothing, as init keeps respawning them. I guess this is a shortcoming. Why won't [K]Ubuntu step away and let me do what I need to?
Announcement
Collapse
No announcement yet.
Unable to unmount /var
Collapse
This topic is closed.
X
X
-
Re: Unable to unmount /var
I wouldn't call it a shortcoming - /var is a system directory and is used to store logs and program data by LOTS of programs.
Can you boot to a liveCD and do what you need?
BTW: when btrfs is ready for the masses we can stop using lvm and raid - preventing a lot of these problems! Soon I hope.
- Top
- Bottom
-
Re: Unable to unmount /var
Originally posted by oshunluvrI wouldn't call it a shortcoming - /var is a system directory and is used to store logs and program data by LOTS of programs.
There are two programs accessing /var in SU mode: statd & rsyslogd. I was able to stop statd by simply commenting these two lines in /etc/init/statd.conf:
#expect fork
#respawn
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Originally posted by rihadI was speaking of single user mode. If admin can't take full control without resorting to workarounds (live CD in this case), then it's a shortcoming.Windows no longer obstructs my view.
Using Kubuntu Linux since March 23, 2007.
"It is a capital mistake to theorize before one has data." - Sherlock Holmes
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Originally posted by SnowhogDid you not understand oshuntervr's comment? In Kubuntu, /var is part of (a branch) the mounted 'root' filesystem). You can not unmount a 'branch'. This is not a bug.
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Originally posted by SnowhogIn Kubuntu, /var is part of (a branch) the mounted 'root' filesystem).
So I'd consider this a valid bug.
EDIT
@rihad:
I can't offer any immediate help because I don't use rsyslog on any of my machines. I use syslog-ng for logging (switched to it from syslog before rsyslog was adopted in ubuntu), which doesn't start (by default) on Single user mode.
So I'd assume rsyslog shouldn't need to start either, could be a bug with either rsyslog (wrong configuration to start in runlevel S) or upstart (doesn't respect configuration)...or a combination of both.
Could you post the contents of your '/etc/init/rsyslog.conf' as I don't have one.
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Originally posted by kubicleCould you post the contents of your '/etc/init/rsyslog.conf' as I don't have one.
I commented these lines in /etc/init/gssd.conf:
#start on (started portmap
# or mount TYPE=nfs4 OPTIONS=sec=*krb5*)
#start on (started portmap or mount TYPE=nfs)
and in pre-start script:
#status portmap | grep -q start/running || start portmap
#start on (local-filesystems
# and net-device-up IFACE=lo)
#expect fork
#respawn
and in script:
# exec portmap $OPTIONS
#start on starting rsyslog
#respawn
#exec dd bs=1 if=/proc/kmsg of=/var/run/rsyslog/kmsg
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Just a thought for future consideration:
Since runlevels 3,4, and 5 are not really used on a debian based system, wouldn't it be not-too-difficult to edit say, runlevel 3 to run the bare minimum?
I see now that a lot of unnecessary stuff is running for "trouble" mode is you're using run level 1.
/etc/rc1.d:
K20acpi-support
K20hddtemp
K20rsync
K20sysstat
K20cdemu-daemon
K20kerneloops
K20saned
K20vboxdrv
K20fancontrol
K20postfix
K20smartmontools
K20winbind
K21spamassassin
K25mdadm
K74bluetooth
K80cups
K99laptop-mode
S30killprocs
S70dns-clean
S70pppd-dns
S90single
Seems like statd is for NFS so should be killed
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Originally posted by rihadUpstart's init tried its best to stop me from doing that.
Instead of commenting out the start blocks, you could try adding stop blocks...something like
stop on runlevel [1S] (stop service in single user mode)
or
stop on runlevel [!2345] (stop service in non-multiuser runlevels)
You might also try adding runlevel requirements in those start blocks, something like
and runlevel [2345]
Haven't had a need to tinker with upstart confs much, so I can't tell for sure whether these mods would work as is, but if you're still interested to try them out they might be worth a shot (although I understood you already worked around your immediate issues)
Also, gssd and statd (judging by your configs) are likely triggered by portmap starting, so stopping portmap from starting might be enough to prevent those services from starting as well. Also preventing rsyslog from starting should also keep rsyslog-kmsg from firing up.
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Originally posted by rihadHi, I need to lvextend the size of an LVM2 volume that /var is on. Obviously I need to unmount /var first, so I dropped to single user shell. Alas, some OS programs are accessing /var in single-user mode preventing me to umount it, according to fuser -vm /var. Killing them solves nothing, as init keeps respawning them. I guess this is a shortcoming. Why won't [K]Ubuntu step away and let me do what I need to?
Confused, If using lvm just extend it while online. Why did you need to unmount the filesystem in the first place. I have extended filesystems online for a long time even var, tmp, even / without issue. I am not able to understand why you believed you needed to unmount var to do the lvextend < to the size you wanted > and do an resize2fs on the file system online resize has worked for years.
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Originally posted by mfburgoI am not able to understand why you believed you needed to unmount var to do the lvextend < to the size you wanted > and do an resize2fs on the file system online resize has worked for years.
The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system
located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel
supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3
only.).
- Top
- Bottom
Comment
-
Re: Unable to unmount /var
Originally posted by rihadOriginally posted by mfburgoI am not able to understand why you believed you needed to unmount var to do the lvextend < to the size you wanted > and do an resize2fs on the file system online resize has worked for years.
The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system
located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel
supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3
only.).
Since you installed, I am assuming from a cd, you could also have booted into rescue mode on the cd opened a shell on your root filesystem which only mounts root and resize there if you are concerned. ( you may need to mount usr for that.
If you need more help let me know I will try it with sone test VM's for you and send you the steps.....
- Top
- Bottom
Comment
Comment