[ubuntu-users] Changing 232.9 NTFS hd to EXT3
Ted Hilts
thilts at mcsnet.ca
Sat Mar 21 17:21:30 UTC 2009
Ray Parrish wrote:
> Ted Hilts wrote:
>
>> This is a resend as the original email has not shown up on the list.
>>
>> I want to know the optimal solution.
>> The hard drive (HD) is 232.9 GB.
>> The application using the HD is the storage of web pages.
>> The HD is currently mounted as NTFS and there is no data on it that I
>> want..
>> Ubuntu is installed in a dual boot grub configuration.with XP HOME.
>> While Ubuntu is booted I want to format this drive.
>> Eventually all but one of the 6 current NTFS formatted hard drives will
>> be changed to EXT3.
>>
>> The following is what I think is the correct use of options to be
>> applied after the 232.9 GB HD has been dismounted by Ubuntu with the
>> command umount "/media/sdc1"
>>
>> sudo /sbin/mkfs.ext3 -c -i 1024 -b 1024 -L HDA1 -v /dev/hda1
>>
>> and then mount the HD. Also, is there anything I have missed?
>>
>> I think the smallest size for blocks is now 1024 but at one time used to
>> be 512.
>>
>> BELOW is the man page synopsis:
>>
>> SYNOPSIS
>> mke2fs [ -c | -l filename ] [ -b block-size ] [ -f
>> fragment-size ] [ -g blocks-per-group ] [ -i
>> bytes-per-inode ] [ -I inode-size ] [ -j ] [ -J journal-options ]
>> [ -N number-of-inodes ] [ -n ] [
>> -m reserved-blocks-percentage ] [ -o creator-os ] [ -O
>> feature[,...] ] [ -q ] [ -r fs-revision-
>> level ] [ -E extended-options ] [ -v ] [ -F ] [ -L volume-label ]
>> [ -M last-mounted-directory ] [ -S
>> ] [ -T filesystem-type ] [ -V ] device [ blocks-count ]
>>
>> mke2fs -O journal_dev [ -b block-size ] [ -L volume-label ] [ -n
>> ] [ -q ] [ -v ] external-journal [
>> blocks-count ]
>>
>> DESCRIPTION
>> mke2fs is used to create an ext2/ext3 filesystem (usually in a
>> disk partition). device is the spe?
>> cial file corresponding to the device (e.g /dev/hdXX).
>> blocks-count is the number of blocks on the
>> device. If omitted, mke2fs automagically figures the file system
>> size. If called as mkfs.ext3 a
>> journal is created as if the -j option was specified.
>>
>>
>> Thanks for any input -- Ted
>>
>>
> Hello,
>
> The only thing I'm seeing so far, is that you are using hda1 when the
> disk was mounted at /media/sdc1, and those don't point at the same kind
> of disk. The use of hda1 is for IDE disks, and would have pointed at the
> first partition on disk one of the IDE interface, while your sdc1 points
> to an scsi drive at position 3, partition 1, I believe. Use "df -h" to
> be certain of the drive designations you should use.
>
> Your -i 1024 is too large of a number for inode size as is explained in
> the following copy from -
>
> <file:///usr/share/doc/HOWTO/en-html/Large-Disk-HOWTO-14.html>
>
> [begin quote] "fdisk will tell you how many blocks there are on the
> disk. If you make a file system on the disk, say with mke2fs, then this
> filesystem needs some space for bookkeeping - typically something like
> 4% of the file system size, more if you ask for a lot of inodes during
> mke2fs. For example:
>
> ||
>
> # sfdisk -s /dev/hda9
> 4095976
> # mke2fs -i 1024 /dev/hda9
> mke2fs 1.12, 9-Jul-98 for EXT2 FS 0.5b, 95/08/09
> ...
> 204798 blocks (5.00%) reserved for the super user
> ...
> # mount /dev/hda9 /somewhere
> # df /somewhere
> Filesystem 1024-blocks Used Available Capacity Mounted on
> /dev/hda9 3574475 13 3369664 0% /mnt
> # df -i /somewhere
> Filesystem Inodes IUsed IFree %IUsed Mounted on
> /dev/hda9 4096000 11 4095989 0% /mnt
> #
>
>
> We have a partition with 4095976 blocks, make an ext2 filesystem on it,
> mount it somewhere and find that it only has 3574475 blocks - 521501
> blocks (12%) was lost to inodes and other bookkeeping. Note that the
> difference between the total 3574475 and the 3369664 available to the
> user are the 13 blocks in use plus the 204798 blocks reserved for root.
> This latter number can be changed by tune2fs. This `-i 1024' is only
> reasonable for news spools and the like, with lots and lots of small
> files. The default would be:
>
> ||
>
> # mke2fs /dev/hda9
> # mount /dev/hda9 /somewhere
> # df /somewhere
> Filesystem 1024-blocks Used Available Capacity Mounted on
> /dev/hda9 3958475 13 3753664 0% /mnt
> # df -i /somewhere
> Filesystem Inodes IUsed IFree %IUsed Mounted on
> /dev/hda9 1024000 11 1023989 0% /mnt
> #
>
>
> Now only 137501 blocks (3.3%) are used for inodes, so that we have 384
> MB more than before. (Apparently, each inode takes 128 bytes.) On the
> other hand, this filesystem can have at most 1024000 files (more than
> enough), against 4096000 (too much) earlier." [end quote]
>
> NOTE: The man page for make.ext2 states that the default inode size is
> 256 so the 128 quoted in the above article excerpt seems to be currently
> incorrect. here's a quote from the man page for mkfs.ext2
>
> [begin quote]
> -I inode-size
> Specify the size of each inode in bytes. mke2fs
> creates 256-byte inodes by default. In kernels after 2.6.10 and some
> earlier vendor kernels it is possible to utilize inodes larger than
> 128-bytes to store extended attributes for improved performance. The
> inode-size value must be a power of two larger or equal to 128. The
> larger the inode-size the more space the inode table will consume, and
> this reduces the usable space in the filesystem and can also negatively
> impact performance. Extended attributes stored in large inodes are not
> visible with older kernels, and such filesystems will not be mountable
> with 2.4 kernels at all. [end quote]
>
> So, it appears to be a trade off between usable file space, number of
> possible files, and performance when specifying the inode sizes, with
> the inability to use the file system with earlier kernels at all, when
> specifying larger inode sizes. This may not be a problem for you, as I
> see that the kernels for Hardy right now are in the 2.6 range, so are
> not affected by this consideration. If you want to use the smaller 128
> size, you will need to specify it with -i, otherwise it seems
> appropriate to use the default 256 size.
>
> I also have not seen any reference to a need to unmount the drive before
> formatting it anywhere.
>
> That's what I could find out.
>
> Later, Ray Parrish
>
>
I think you are correct on the drive type. The drives I am thinking of
formating are the 6 original NTFS hard drives on the XP Home machine.
When I added the dual boot arrangement to include Ubuntu I had an 80 GB
empty partition on one of the drives and so Ubuntu "/" was placed on
this 80 GB partition when it was installed.
Back to the drive type of these 6 hard drives. It's too bad I did not
notice that the drives are SCSI and not IDE types. Old age is setting in
and it seems I have memory issues to deal with because of that
condition. (1) Anyway, I agree that I should be using sda1 instead of
hda1. (2) Also, but I'm not sure about this, I don't think there is a
problem in me designating sda1 for the first hard dive on which I do the
conversion to ext3 as I don't think the physical location and physical
order of the hard drives is of any importance but rather the label of
the hard drive is probably what the kernel looks for. (3) Also, in my
case, "/" is on it's own partition and the hard drive label designation
could be labeled sda1 regardless of it's previous windows XP
designation. (4) Also it has occurred to me that I will have to change
/etc/fstab to get rid of the windows designation of the hard drive I am
converting so that the Linux designation of that drive replaces it. (5)
Also, if I use the designation sda1 it would not be set as ACTIVE as it
would be if "/" (system root) was placed on it. Or am I in error on
one or other of these points???
In terms of the formatting command line you seem to be saying that for
many small files the following might be in order:
sudo /sbin/mkfs.ext3 -c -b 1024 -L SDA1 -v /dev/sda1
In other words (for small files like web pages) go with the defaults but use block size 1024 which I think is the smallest???
Hope to hear more input from you and others -- Thanks, Ted
More information about the ubuntu-users
mailing list