Subject: Re: 36GB / , help!
To: Piotr Stolc <socrtp@soclab.eu.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-users
Date: 12/21/2003 21:38:39
On Fri, Dec 19, 2003 at 08:49:42PM +0100, Piotr Stolc wrote:
> hi,
> I have one machine with base NetBSD 1.6.1 installed with only one fs - 36GB
> rootfs:
> 
> 16 partitions:
> #        size    offset     fstype  [fsize bsize cpg/sgs]
>  a:  70589547        63     4.2BSD   4096 32768    64   # (Cyl.    0*- 4393)
>  b:   1057622  70589610       swap                      # (Cyl. 4394 - 4459*)
> 
> 
> the problem is that I don't have physical access to that machine.
> on / is only NetBSD base system without any packages and data - only 166MB
> used.
> 
> is there any way to preserve first sectors on / to install new kernel in
> the future? or maybe there is a method to shrink rw-mounted fs?

Unless you machine is really old, you should not have any problems loading
the kernel from the end of disk. The NetBSD boot loader has been able to use
LBA when available for a long time.

> 
> can I create there a new root partition located at <1024 without crashing
> system - I just want to copy basesystem there, modify disklabel to the new
> sd0a point and reboot.
> on which sectors I should create that fs to be sure it will boot?
> 
> I don't have any other ideas what could I do...please, help me!

If your machine can't do LBA the only way would be to reinstall with a small
/ at start of disk. But I think if your box couldn't do LBA you'd be already
in trouble.
You can see the blocks used by the kernel using fsdb:
#fsdb -n -f /dev/rwd0a
** /dev/rwd0a (NO WRITE)
Editing file system `/dev/rwd0a'
Last Mounted on /
current inode: directory
I=2 MODE=40755 SIZE=512
        MTIME=Dec 21 12:02:20 2003 [170000000 nsec]
        CTIME=Dec 21 12:02:20 2003 [170000000 nsec]
        ATIME=Dec 21 12:16:41 2003 [720000000 nsec]
OWNER=root GRP=wheel LINKCNT=20 FLAGS=0x0 BLKCNT=0x2 GEN=0x7cb4f9e
fsdb (inum: 2)> ls
[...]
slot 8 ino 102 reclen 16: regular, `netbsd'
[...]
fsdb (inum: 10)> inode 102
current inode: regular file
I=102 MODE=100755 SIZE=3345355
        MTIME=Dec 21 12:09:50 2003 [410000000 nsec]
        CTIME=Dec 21 12:09:50 2003 [410000000 nsec]
        ATIME=Dec 21 18:24:07 2003 [540000000 nsec]
OWNER=root GRP=wheel LINKCNT=1 FLAGS=0x0 BLKCNT=0x19a0 GEN=0x28560eb9
fsdb (inum: 102)> blks
I=102 6560 blocks
Direct blocks:
0: 6216 6224 6232 6240 6248 6256 6264 6272 6280 6288 6296 6304 
Indirect block 6312 (level 1):
12: 6320 6328 6336 6344 6352 6360 6368 6376 6384 6392 6400 6408 6416 6424 
[...]

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 23 ans d'experience feront toujours la difference
--