FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-18-2008, 05:29 AM
Antony
 
Default moving /usr, /var, and /etc

I have a Debian system on really small Flash memory like an embed system. A hard drive is mounted onto the system. I want to add more processes to the system like mail server. But the problem is /usr, /var, /etc are running out of space on the Flash memory. I'm planning to do the following:


- make /usr, /var, /etc, /home directories on the mounted hard drive.
- copy /usr, /var, /etc, /home original directories to new created directories.
- edit /etc/fstab to mount these directories to new created locations.

- remove the old /usr, /var, /etc, /home directories.

Is that unsafe to do so?
Do files in these directories being accessed before mounting from /etc/fstab?
 
Old 04-18-2008, 08:34 AM
Jörg-Volker Peetz
 
Default moving /usr, /var, and /etc

Antony wrote:
I have a Debian system on really small Flash memory like an embed
system. A hard drive is mounted onto the system. I want to add more
processes to the system like mail server. But the problem is /usr, /var,
/etc are running out of space on the Flash memory. I'm planning to do
the following:


- make /usr, /var, /etc, /home directories on the mounted hard drive.
- copy /usr, /var, /etc, /home original directories to new created
directories.

- edit /etc/fstab to mount these directories to new created locations.
- remove the old /usr, /var, /etc, /home directories.

Is that unsafe to do so?
Do files in these directories being accessed before mounting from
/etc/fstab?


Doesn't it suffice to move just /var, /tmp and /home to the hard drive?
I would make one partition for /var and one for /home. Then link /tmp to
/dev/shm which must be done in a boot script (see for example kernel
documentation .../linux/Documentation/filesystems/tmpfs.txt).

--
Regards,
Jörg-Volker.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-18-2008, 08:59 AM
"Digby Tarvin"
 
Default moving /usr, /var, and /etc

On Fri, Apr 18, 2008 at 01:29:29PM +0800, Antony wrote:
> I have a Debian system on really small Flash memory like an embed system. A
> hard drive is mounted onto the system. I want to add more processes to the
> system like mail server. But the problem is /usr, /var, /etc are running out
> of space on the Flash memory. I'm planning to do the following:
>
> - make /usr, /var, /etc, /home directories on the mounted hard drive.
> - copy /usr, /var, /etc, /home original directories to new created
> directories.
> - edit /etc/fstab to mount these directories to new created locations.
> - remove the old /usr, /var, /etc, /home directories.
>
> Is that unsafe to do so?
> Do files in these directories being accessed before mounting from
> /etc/fstab?

Let me get this straight.... you are going to update fstab, which
resides in /etc, with information telling the system how to mount
/etc?

Moving /usr, /var and /home should be fine - it is quite normal to
have those as separate filesystems. You shouldn't really have to
move /etc (it shouldn't grow that much) but if you really want to
it won't be a simple minded task.

Regards,
DigbyT


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-18-2008, 10:57 AM
NN_il_Confusionario
 
Default moving /usr, /var, and /etc

On Fri, Apr 18, 2008 at 01:29:29PM +0800, Antony wrote:
> the problem is /usr, /var, /etc are running out
> of space on the Flash memory.
> Do files in these directories being accessed before mounting from
> /etc/fstab?

as other already have said, /usr /var /home give no problems.

But /etc/inittab is inmediately read by /sbin/init which is the default
number 1 process executed from the kernel at boot.

See http://lists.debian.org/debian-user/2008/04/mail3.html and that thread

--
Chi usa software non libero avvelena anche te. Digli di smettere.
Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale.
Informatica=bomba: intelligente solo per gli stupidi che ci credono.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-18-2008, 04:24 PM
Bob McGowan
 
Default moving /usr, /var, and /etc

Antony wrote:
I have a Debian system on really small Flash memory like an embed
system. A hard drive is mounted onto the system. I want to add more
processes to the system like mail server. But the problem is /usr, /var,
/etc are running out of space on the Flash memory. I'm planning to do
the following:


- make /usr, /var, /etc, /home directories on the mounted hard drive.
- copy /usr, /var, /etc, /home original directories to new created
directories.

- edit /etc/fstab to mount these directories to new created locations.
- remove the old /usr, /var, /etc, /home directories.

Is that unsafe to do so?
Do files in these directories being accessed before mounting from
/etc/fstab?


Others have noted issues with moving /etc

I would suggest that you do all this in single user mode, to begin with.

And, once you have the 3 systems copied and fstab updated, reboot.

Then, if all is well, you can remove the original directories on the
flash drive.


If something unexpected happens, you should be able to boot to single
user mode again (if there was a boot problem, you may well be there or
in a busybox init shell, already), and work on it.


--
Bob McGowan
 
Old 04-18-2008, 05:50 PM
"Damon L. Chesser"
 
Default moving /usr, /var, and /etc

Antony wrote:
I have a Debian system on really small Flash memory like an embed
system. A hard drive is mounted onto the system. I want to add more
processes to the system like mail server. But the problem is /usr, /var,
/etc are running out of space on the Flash memory. I'm planning to do
the following:


- make /usr, /var, /etc, /home directories on the mounted hard drive.
- copy /usr, /var, /etc, /home original directories to new created
directories.

- edit /etc/fstab to mount these directories to new created locations.
- remove the old /usr, /var, /etc, /home directories.

Is that unsafe to do so?
Do files in these directories being accessed before mounting from
/etc/fstab?

Antony,

As I see it, there should be no issues at all with your plan. It is
true that /etc needs to be accessed 100% of the time, however, if you
copied /etc to a new / location, edited /etc/fstab to reflect the new
file locations for your new tree structure, then issued mount -a or
perhaps mount -a -o remount, rw (I confess I have not done this for /,
see man mount) but I think mount -a will work just fine. /etc is not
special in any way, just before the mount -a it will path to your usb
drive and after (unless you make a mistake in fstab) it will path to
your new tree structure. Since all the files are the same, the running
kernel will not see any difference and your running process should not
see any difference.


I just don't see the concern others have posted about moving /etc,
perhaps there is an error on my understanding that needs to be cleared
up? What is the difference between doing this and say untaring your
backup or doing a chroot (which now points to a different file
structure)? Now if you have a mistake in fstab, I see bad things
happening that might require a recovery boot to fix.


I am awaiting the results to increase my understanding.

HTH

--
Damon L. Chesser
damon@damtek.com
http://www.linkedin.com/in/dchesser


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-18-2008, 06:26 PM
NN_il_Confusionario
 
Default moving /usr, /var, and /etc

On Fri, Apr 18, 2008 at 12:50:33PM -0500, Damon L. Chesser wrote:
> true that /etc needs to be accessed 100% of the time, however, if you
> copied /etc to a new / location, edited /etc/fstab to reflect the new
> file locations for your new tree structure, then issued mount -a or
> perhaps mount -a -o remount, rw

[snip]

> Since all the files are the same, the running
> kernel will not see any difference and your running process should not
> see any difference.

files descriptors that already running processes use to access files
still point to old files (the ones that were il place when the file
descriptor was created). Since at least /sbin/init (but almost any other
daemon) has an open (configuration) file in /etc all such processes
should be restarted (or reloaded, when reload is possible and
sufficient). If any file (/etc/mtab ?) is open in read-write mode, this
is a must, not only a should.

See http://lists.debian.org/debian-user/2008/04/msg01213.html and its thread

--
Chi usa software non libero avvelena anche te. Digli di smettere.
Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale.
Informatica=bomba: intelligente solo per gli stupidi che ci credono.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-29-2008, 02:18 AM
"Douglas A. Tutty"
 
Default moving /usr, /var, and /etc

On Fri, Apr 18, 2008 at 09:24:59AM -0700, Bob McGowan wrote:
> I would suggest that you do all this in single user mode, to begin with.

Debian's single-user mode ends up with everything mounted. It is safer
to boot with a kernel command line of init=/bin/sh which bypasses all
the init scripts (and init itself too) and just gives you a shell. You
can manually run any initscripts you need (in the correct order with the
"start" parameter), then get your partitions set up.

>
> And, once you have the 3 systems copied and fstab updated, reboot.

I agree that a copy is safer than a move; perhaps e.g mv /var /oldvar so
you have it just in case.

>
> Then, if all is well, you can remove the original directories on the
> flash drive.
>
> If something unexpected happens, you should be able to boot to single
> user mode again (if there was a boot problem, you may well be there or
> in a busybox init shell, already), and work on it.

init=/bin/sh is your friend. You can also install sash (stand-alone
shell, sort of like busybox called as sash) and use init=/bin/sash.

Doug.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 08:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org