bug-parted
[Top][All Lists]
Advanced

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

Re: general partition questions


From: Szakacsits Szabolcs
Subject: Re: general partition questions
Date: Sat, 13 Nov 2004 00:51:02 +0100 (MET)

Hello,

On Fri, 12 Nov 2004, B.Hakvoort wrote:

> - Is there a generic way to determine the amount of used space in a
> partition/filesystem? I need to know this to set the min. size while
> resizing a partition.

If the partition is mounted then statfs. 

Otherwise it depends on the filesystem but often external utilities can
tell that too, e.g.

        ntfsresize -fi device | grep 'Space in use'
        Space in use       : 5250 MB (62.6%)
 
> - I want to use 'dd' to copy partitions. Although sloooow, it seems to

It's possible to speed up the copy for xfs, ntfs and perhaps for ext[23]
too by xfs_copy, ntfsclone and e2image (-r option?).

> be very reliable 

Independently whatever you use for bit-to-bit copy, if the partition is
used for booting then people may end up having an unbootable system,
depending on the bootloader, filesystems. Solutions are different for the
different cases.

> and if doesn't care about the filesystem, so no problems there. Has
> any of you guys some advice to offer on which parameters i should use?
> Or maybe why i should NOT use 'dd' ;) 

dd is a good start. 

Probably you should be aware also that kernels earlier than 2.6 couldn't
read the last sectors of partitions if it was odd thus people lost that
sector, being filesystem data, gpt, ntfs backup boot sector or whatever
else.

> (i've tested it like : dd if=/dev/hda1 of=/dev/hda2 works like a
> charm)

Using bs=8192 can significantly speed up the process _occasionally_ and
people also love the 'noerror' option if they have a dying disk and they
would like to save the still readable data.

BTW, speed: checking if DMA is enabled on IDE disks may be a good idea
too. Otherwise people with disabled DMA will blame gparted how sloooow 
it is. I've seen even close to 100x slow downs in some cases.

        Szaka





reply via email to

[Prev in Thread] Current Thread [Next in Thread]