tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: disklabel(8) allows addressing non-existent space



On Sun, Jan 01, 2012 at 08:00:45PM -0500, Thor Lancelot Simon wrote:
> On Fri, Dec 30, 2011 at 02:18:59AM +0100, Julian Djamil Fagir wrote:
> > Hi,
> > 
> > I just played a bit around with disklabel(8), trying to copy checks for
> > batch-mode, but then I found out: There are virtually no checks checking the
> > disklabel for consistency.
> 
> I have on many occasions used disklabel to adjust the partition table
> before block-copying a disk's contents to a different-size disk.  I'd
> be pretty irritated if that stopped working.

One thing I found when 'playing' with this code a few years ago, is that
the kernel fs code (think bounds_check_with_label()...) uses the current
base/size of the partition, not the values (base in particular) defined
when the filesystem was mounted!
Changing the base of a partition with a mounted fs is likely to destroy
the fs and disk contents.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index