Date: Sun, 22 Aug 2010 09:14:18 -0700 From: Marcel Moolenaar <xcllnt@mac.com> To: "Andrey V. Elsukov" <bu7cher@yandex.ru> Cc: Alexander Motin <mav@freebsd.org>, Marcel Moolenaar <marcel@freebsd.org>, Konstantin Belousov <kib@freebsd.org>, freebsd-geom@freebsd.org Subject: Re: RFC: destroying non empty partition tables with gpart(8) Message-ID: <2AEF046C-476D-4AE6-9CF7-92DF45B35C5D@mac.com> In-Reply-To: <4C70EB80.5050901@yandex.ru> References: <4C70EB80.5050901@yandex.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 22, 2010, at 2:18 AM, Andrey V. Elsukov wrote: > Hi All. > > I think gpart(8) is default way to create partition tables and manage > partitions in head/ and stable/8. Now when you want to destroy partition > table you should delete all partitions from it. This is not so bad, but > i made a patch that add ability destroy table with auto deleting all > partitions. For example: > > # gpart destroy -r ada1 > > I did it in user space, it just delete all partition entries before > destroying table. At this time if deleting of some partition failed > you can do `gpart undo ada1` and all already deleted by last command > partition will be restored. It seems usable for me. > > Any comments? Very nice! I'm pleased to see this done in userspace, as it's exactly where you want this. I haven't actually looked at the patch, but in case you didn't: consider disabling the auto- commit on the delete requests and use commit/undo to create an automic operation: 1) use commit when everything could be deleted without error. this makes it permanent. 2) use the undo in case there's an error. This "unwinds" the the sequence of operations that succeeded so far, giving you the all or nothing behaviour. FYI, -- Marcel Moolenaar xcllnt@mac.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2AEF046C-476D-4AE6-9CF7-92DF45B35C5D>