reduce partition size. HELP
kes-kes at yandex.ru
Tue Jan 3 20:52:47 UTC 2012
Вы писали 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
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)
and having, except single user mode, another option in boot promt:
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 at yandex.ru
More information about the freebsd-questions