Subject: Re: HowTo move NetBSD 2.0.2 from larger to smaller HardDisk?
To: None <netbsd-help@netbsd.org>
From: bsd.petr@seznam.cz <bsd.petr@seznam.cz>
List: netbsd-help
Date: 07/19/2005 11:05:04
James K. Lowden napsal(a):

>bsd.petr@seznam.cz wrote:
>  
>
>>Hi everybody,
>>i need to move my NetBSD 2.0.2 from old 4 GB HDD to new 1.2 GB HDD. Is 
>>there some program as Norton Ghost or Acronis TrueImage with UFS file 
>>system support? 
>>    
>>
>
>There are many free alternatives.  One is http://www.feyrer.de/g4u/.  I'm
>not sure how many will be much use, though, because your target system is
>much smaller than your source.  You have to do a file-by-file copy, not a
>filesystem image.  
>  
>
Thanks for above link. I have a idea. Is it possible way tu resize UFS 
partition without data-loss to a smaller (equal or lower then 1.2 GB) 
size (which program or command can do it)? And then use g4u for cloning 
HDD? But i'm afraid that standard instalation of NetBSD 2.0.2 create 
more then one partiton (e.g. /boot, /, SWAP) and if I resize the "/" 
partition, SWAP partition will be still behind the 1.2 GB limit of my 
new HDD.

>  
>
>>Or could you tell me please how can i do it manually 
>>from NetBSD command line?
>>    
>>
>
>Approximately:
>
>1.  fdisk(8)
>2.  newfs(8)
>3.  dump(8)
>4.  restore(8)
>
>You can pipe dump | restore, so you don't create a dump image.  Do it in
>single-user mode for your own sanity.  
>
>  
>
>>1) Which folders i can delete "some large folders as KDE, Gnome but from
>>
>>where are they" (I using only Samba 3, Apache 2 + SSL, MySQL 4, PHP 4) 
>>to decrease the used space on old HDD?
>>    
>>
>
>Well, if the software you don't want was installed with pkgsrc, I'd
>suggest pkg_delete(1) is your friend.  
>  
>
Yes but I installed only a few packakges as i need. I think which 
unneeded folders from NetBSD 2.0.2 installation i can delete and this 
operation do NOT harm the operating system. (Now my partiton with NetBSD 
occuping 1.45 GB and i have to reduce it.)

>  
>
>>4) How can I install "NetBSD boot loader" for start system from new 1.2 
>>GB HDD?
>>    
>>
>
>That would be disklabel -B, I believe.  
>
>Once you have your new filesystem in place and have restored your files to
>it, you can first reboot and use boot(8) to boot from the new disk before
>you make any hardware changes.  That's always a treat.  Just bring it up
>single-user, though, because your fstab will still be pointing to wd0,
>even though your root partion will be wd1a.  ISTR that even if you change
>the boot drive in your BIOS, NetBSD still keeps the same device names. 
>You can leave yourself booting from wd1 and adjust your fstab, or
>physically swap the disks on the IDE bus.  
>
>--jkl
>  
>
After migrate process how can I create corresponding swap on the end of 
disk on new 1.2 GB HDD?

Your's Sincerely
Petr Novak - bsd.petr@seznam.cz

PS: Im newbie in BSD world. I using M$ on desktop and a little linux on 
students servers. But one of theese serveres have something bad on 
motherboard and NetBSD is only one stable system on this hardware (I 
tried M$, Debian Linux/Hurd, SuSE, Ferdora, Hurd, Free/Open/NetBSD on 
that hardware.). And so, IMHO, NetBSD is prittyest from BSDs.