Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jan 2012 22:52:40 +0200
From:      =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= <kes-kes@yandex.ru>
To:        Polytropon <freebsd@edvax.de>
Cc:        Robert Huff <roberthuff@rcn.com>, freebsd-questions@freebsd.org
Subject:   Re[2]: reduce partition size. HELP
Message-ID:  <896934352.20120103225240@yandex.ru>
In-Reply-To: <20111231171538.fd1156fb.freebsd@edvax.de>
References:  <211353632.20111231040344@yandex.ru> <20222.32401.326222.536203@jerusalem.litteratus.org> <1112244537.20111231112327@yandex.ru> <alpine.BSF.2.00.1112310841430.50853@wonkity.com> <20111231171538.fd1156fb.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Здравствуйте, 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?896934352.20120103225240>