From owner-freebsd-questions@FreeBSD.ORG Tue Jan 3 20:52:47 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27043106566B for ; Tue, 3 Jan 2012 20:52:47 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward6.mail.yandex.net (unknown [IPv6:2a02:6b8:0:202:22cf:30ff:fe6b:6ebc]) by mx1.freebsd.org (Postfix) with ESMTP id 88DE78FC17 for ; Tue, 3 Jan 2012 20:52:46 +0000 (UTC) Received: from smtp7.mail.yandex.net (smtp7.mail.yandex.net [77.88.61.55]) by forward6.mail.yandex.net (Yandex) with ESMTP id AD4EF112161E; Wed, 4 Jan 2012 00:52:44 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1325623964; bh=l7FmYfSkkHs+DBGTkuxwyl5Q0gZN81/z+FDH0RpbpbA=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=vXss6BvyMZyO6EmAR4DgMORS3yWrDNma7DqSHcPDD07skf9CObK4yO84dz6vzgCay weK0uSJN7RmnD7VPz/VmKVhNNBAGq3ms9ZK6e0oieSUVfXjaNUFwlgRpK+CzH9bEUS abhu9sSoSMkaSh7W6KOGXDNEHMZvCtSzQGuD770w= Received: from smtp7.mail.yandex.net (localhost [127.0.0.1]) by smtp7.mail.yandex.net (Yandex) with ESMTP id 7150F15803CF; Wed, 4 Jan 2012 00:52:44 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1325623964; bh=l7FmYfSkkHs+DBGTkuxwyl5Q0gZN81/z+FDH0RpbpbA=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=vXss6BvyMZyO6EmAR4DgMORS3yWrDNma7DqSHcPDD07skf9CObK4yO84dz6vzgCay weK0uSJN7RmnD7VPz/VmKVhNNBAGq3ms9ZK6e0oieSUVfXjaNUFwlgRpK+CzH9bEUS abhu9sSoSMkaSh7W6KOGXDNEHMZvCtSzQGuD770w= Received: from unknown (unknown [77.93.52.20]) by smtp7.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qh3eu3V0-qi3edZ4e; Wed, 4 Jan 2012 00:52:44 +0400 X-Yandex-Spam: 1 Date: Tue, 3 Jan 2012 22:52:40 +0200 From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?windows-1251?B?188gyu7t/Oru4iwgRnJlZUxpbmU=?= X-Priority: 3 (Normal) Message-ID: <896934352.20120103225240@yandex.ru> To: Polytropon In-Reply-To: <20111231171538.fd1156fb.freebsd@edvax.de> References: <211353632.20111231040344@yandex.ru> <20222.32401.326222.536203@jerusalem.litteratus.org> <1112244537.20111231112327@yandex.ru> <20111231171538.fd1156fb.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit Cc: Robert Huff , freebsd-questions@freebsd.org Subject: Re[2]: reduce partition size. HELP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 20:52:47 -0000 Здравствуйте, Polytropon. Вы писали 31 декабря 2011 г., 18:15:38: P> On Sat, 31 Dec 2011 08:45:32 -0700 (MST), Warren Block wrote: >> On Sat, 31 Dec 2011, ??????? ??????? wrote: >> >> > ????????????, Robert. >> > >> > ?? ?????? 31 ??????? 2011 ?., 5:16:33: >> > >> > >> > RH> =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= writes: >> > >> >>> Is there any way to reduce partition size on live system? >> > >> > RH> No. >> > RH> Basic steps: >> > RH> 0) go to single-user; unmount partition >> > RH> 1) backup affected partition; test backup >> > RH> 2) delete old partition >> > RH> 3) create new/smaller partition >> > RH> 4) restore from backup >> > >> > is there a way to goto singe-user through ssh? >> >> Single-user and unmounted partitions are desirable but not required. >> See dump(8) about the -L option. P> Of course. And in addition, how about that? P> NOT TESTED! READ *FULLY* BEFORE DOING ANYTHING! P> For this example, /dev/ad0s1a is the / partition. P> There are other partitions (such as /var or /home) P> associated to other device files. Let's also P> assume /dev/ad0s1e is the /var partition. P> Onto the /var partition (or /home or any scratch P> oartition), copy the content from / (primarily P> because of /sbin, /bin and maybe /etc); maybe P> use this approach: P> # cd /var P> # dump -0 -L -a -u -f - /dev/ad0s1a | restore -r -f - P> Make sure /var does _not_ contain directory P> names identical to those found on the / partition! P> As I said, maybe use /scratch. :-) P> (Oh, and you can of course shorten the dump P> parameters to -0Lauf and restore's to -rf, P> but I chose this representation for making P> implicitely clear why to use _those_ options.) P> Then umount / and mount /var (I'll keep this P> for the example) as the new / (which now has P> all the things / should have): P> # umount /var P> # umount -f / ; mount -t ufs /dev/ad0s1e / I have not tryed, but man says that 'root can not be unmounted'... (( -f The file system is forcibly unmounted. Active special devices continue to work, but all other files return errors if further accesses are attempted. The root file system cannot be forcibly unmounted. P> Then the device associated to / should be free P> to be unmounted - a step desirable, but it should P> be no a "big" problem to operate on the device P> files associated with a _mounted_ partition. P> The more I think about it... /var is a really P> bad choice. Use /scratch, or at least /home. P> AGAIN: NOT TESTED! MAY BLOWENFUSEN & CORKENPOPPEN! :-) It will be very nice to have legacy installed mfsbsd in some reserved space in swap (like for kenel dumps) http://www.freebsd.org/doc/en/articles/remote-install/preparation.html and having, except single user mode, another option in boot promt: mfsbsd mode. and 'nextboot --mfsbsd' to set remotely that boot option. also be very very nice to have behaviour which loads mfsbsd in case of unproper unmount. Now it is promt to enter #/bin/sh path. Having mfsbsd installed allow remotely complete/correct all failed operations that cause normal loading. also AUTO booting mfsbsd in all cases that crash current system: panic, deadlock os something else, will allow to analise many things remotely and save, in some cases, many many time =) -- С уважением, Коньков mailto:kes-kes@yandex.ru