I want to convert all my NTFS partitions to ext3 since I'm no longer running Windows, at least on my main machine at home. I'm planning to tar the NTFS partitions to an existing ext3, reformat the partition as ext3 and untar it back.
What is the best way to accomplish step two of this - reformatting the partition? I've only done this so far during the installation phase, and that was for partitions I knew I could destroy with impunity. I'm guessing I unmount the drive, <do something magic here> and remount it. It's the magic part I don't know.
Thanks.
Mark Hull-Richter Linux Kernel Engineer (949) 680-3082 - Office (949) 680-3001 - Fax (949) 632-8403 - Mobile mhull-richter@datallegro.com mailto:mhull-richter@datallegro.com www.datallegro.com http://www.datallegro.com 85 Enterprise, Second Floor, Aliso Viejo, CA 92656
On Fri, 16 Mar 2007 at 2:41pm, Mark Hull-Richter wrote
What is the best way to accomplish step two of this - reformatting the partition? I've only done this so far during the installation phase, and that was for partitions I knew I could destroy with impunity. I'm guessing I unmount the drive, <do something magic here> and remount it. It's the magic part I don't know.
'man mke2fs' has all the details. I usually do:
mke2fs -b 4096 -j -m 1 -O dir_index $DEVICE
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Joshua Baker-LePain Sent: Friday, March 16, 2007 11:45 AM To: CentOS mailing list Subject: Re: [CentOS] Changing from NTFS to ext3
'man mke2fs' has all the details. I usually do:
mke2fs -b 4096 -j -m 1 -O dir_index $DEVICE
Perfect - thanks!
Mark Hull-Richter wrote:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Joshua Baker-LePain Sent: Friday, March 16, 2007 11:45 AM To: CentOS mailing list Subject: Re: [CentOS] Changing from NTFS to ext3
'man mke2fs' has all the details. I usually do:
mke2fs -b 4096 -j -m 1 -O dir_index $DEVICE
Perfect - thanks!
It's not. It'll probably work, but perfect it isn't.
You should repartition first, if only to get the partitions right. Take a look at fdisk.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of John Summerfield Sent: Friday, March 16, 2007 12:54 PM To: CentOS mailing list Subject: Re: [CentOS] Changing from NTFS to ext3
It's not. It'll probably work, but perfect it isn't.
You should repartition first, if only to get the partitions right.
Take
a look at fdisk.
Foolish question: why would the partition table or partitions not be "right" and what constitutes "right" in this context?
Mark Hull-Richter wrote:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of John Summerfield Sent: Friday, March 16, 2007 12:54 PM To: CentOS mailing list Subject: Re: [CentOS] Changing from NTFS to ext3
It's not. It'll probably work, but perfect it isn't.
You should repartition first, if only to get the partitions right.
Take
a look at fdisk.
Foolish question: why would the partition table or partitions not be "right" and what constitutes "right" in this context?
There's a field called "type" You don't want it set to "mountable filesystem" - commonly called hpfs/ntfs.
Use fdisk to list the partitions and see. Also, I think XP plays games with the space, reserves some outside partitions.
John Summerfield wrote:
There's a field called "type" You don't want it set to "mountable filesystem" - commonly called hpfs/ntfs.
Use fdisk to list the partitions and see. Also, I think XP plays games with the space, reserves some outside partitions.
It would be nice if mke2fs could look at the partition type (if it's a true disk partition, and not a file mounted -o loop or something like that) and give a warning if the partition type is not 83 (Ext2/3).
I guess that would complicate the application logic quite a bit, but I lost count how many times I reformatted a partition and forgot to kick the partition type with fdisk. :-/
Florin Andrei wrote:
John Summerfield wrote:
There's a field called "type" You don't want it set to "mountable filesystem" - commonly called hpfs/ntfs.
Use fdisk to list the partitions and see. Also, I think XP plays games with the space, reserves some outside partitions.
It would be nice if mke2fs could look at the partition type (if it's a true disk partition, and not a file mounted -o loop or something like that) and give a warning if the partition type is not 83 (Ext2/3).
mke2fs is not a partitioning tool, it's for creating filesystems. Doesn't need to be on a device:
dd if=/dev/zero of=/tmp/ext-fs seek=$((4*1024*1024)) count=0 mke2fs -F -q /tmp/ext-fs
and it doesn't need to be partitioned. one could mke2fs /dev/sda
I guess that would complicate the application logic quite a bit, but I lost count how many times I reformatted a partition and forgot to kick the partition type with fdisk. :-/
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of John Summerfield Sent: Friday, March 16, 2007 2:44 PM To: CentOS mailing list Subject: Re: [CentOS] Changing from NTFS to ext3
mke2fs is not a partitioning tool, it's for creating filesystems.
For the record, what I did was as follows. For each partition I had that was FAT32 or NTFS (I have one finishing, I hope, now, and one left to go), I did the following:
cd /mnt/X # where X was the partition corresponding to WXP drive X tar cvf <elsewhere>/X.tar * cd .. umount /dev/<X's-dev> fdisk -l # to verify the partition map - they were all ok # actually, for one of the partitions I found some unused space I had set # aside long ago and used fdisk to merge the two partitions. mke2fs -b 4096 -j -m 1 -O dir_index /dev/<X's-dev> umount /dev/<X's-fellow-partitions-on-the-same-disk> # For the boot drive partitions I couldn't do this and had to reboot # after the fdisk fdisk # to set the partition type to Linux from HTFS/NTFS vi /etc/fstab # to fix the entry for X mount -a cd /mnt/X tar xvf <elsewhere>/X.tar
Then I changed the ownerships and permissions to I (the main user) owned and had full access to all of them. Since there were no Linux executables or shell scripts in any of the old Windows partitions, this was simple.
Thanks for all your help, everyone - I am now a CentOS devotee.
mhr
Joshua Baker-LePain wrote:
On Fri, 16 Mar 2007 at 2:41pm, Mark Hull-Richter wrote
What is the best way to accomplish step two of this - reformatting the partition? I've only done this so far during the installation phase, and that was for partitions I knew I could destroy with impunity. I'm guessing I unmount the drive, <do something magic here> and remount it. It's the magic part I don't know.
'man mke2fs' has all the details. I usually do:
mke2fs -b 4096 -j -m 1 -O dir_index $DEVICE
What are the parameters used by the installer to format a partition? I believe it's simply "mke2fs -j $DEVICE" but I may be wrong.
On Fri, 16 Mar 2007 at 2:11pm, Florin Andrei wrote
Joshua Baker-LePain wrote:
On Fri, 16 Mar 2007 at 2:41pm, Mark Hull-Richter wrote
What is the best way to accomplish step two of this - reformatting the partition? I've only done this so far during the installation phase, and that was for partitions I knew I could destroy with impunity. I'm guessing I unmount the drive, <do something magic here> and remount it. It's the magic part I don't know.
'man mke2fs' has all the details. I usually do:
mke2fs -b 4096 -j -m 1 -O dir_index $DEVICE
What are the parameters used by the installer to format a partition? I believe it's simply "mke2fs -j $DEVICE" but I may be wrong.
Have a look with tune2fs (see below). Default mke2fs behavior (on centos4 at least) does *not* turn on dir_index, thus why I included it above. Also, mke2fs defaults to having the new filesystem checked every so many days or mounts, which anaconda turns off. So a mke2fs should be followed by:
tune2fs -c0 -i0 $DEVICE
[jlb@chaos ~]$ sudo tune2fs -l /dev/hda1 tune2fs 1.35 (28-Feb-2004) Filesystem volume name: /1 Last mounted on: <not available> Filesystem UUID: 5679b769-446c-48f4-aea9-a72cfe61f38a Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file Default mount options: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 1048576 Block count: 2096474 Reserved block count: 104823 Free blocks: 969847 Free inodes: 889498 First block: 0 Block size: 4096 Fragment size: 4096 Reserved GDT blocks: 511 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 16384 Inode blocks per group: 512 Filesystem created: Thu Sep 22 03:59:32 2005 Last mount time: Thu Feb 8 12:36:33 2007 Last write time: Thu Feb 8 12:36:33 2007 Mount count: 29 Maximum mount count: -1 Last checked: Thu Sep 22 03:59:32 2005 Check interval: 0 (<none>) Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 128 Journal inode: 8 First orphan inode: 776382 Default directory hash: tea Directory Hash Seed: 1c2cefd8-ed4a-49f0-9048-1de30d1ac4b6 Journal backup: inode blocks
Mark Hull-Richter spake the following on 3/16/2007 11:41 AM:
I want to convert all my NTFS partitions to ext3 since I’m no longer running Windows, at least on my main machine at home. I’m planning to tar the NTFS partitions to an existing ext3, reformat the partition as ext3 and untar it back.
What is the best way to accomplish step two of this – reformatting the partition? I’ve only done this so far during the installation phase, and that was for partitions I knew I could destroy with impunity. I’m guessing I unmount the drive, <do something magic here> and remount it. It’s the magic part I don’t know.
Thanks.
How much data do you actually need from the ntfs partitions? There is no use keeping everything, as most of it will be useless to linux. Is there some room on the drive for an extra partition? You could create a fat32 partition large enough to hold the data you want to keep, and dump the rest.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Friday, March 16, 2007 11:53 AM To: centos@centos.org Subject: [CentOS] Re: Changing from NTFS to ext3
How much data do you actually need from the ntfs partitions?
All of it - it's data files, not programs, so I need everything there. I have an enormous collection of images, movies, archives (some of which are really trash, but as long as they're not too large, which they are not, I'll keep 'em for historical purposes). One of the drives I use mainly for online backups of important data from the other drives - kind of a hedge between DVD backups.
The two partitions that have a lot of Windows stuff on them I need because that's where the Windows-on-vmware stuff I'll be using lives. I'm of more than half a mind to ditch the whole C drive partition, though. I don't think there's any valuable data there, just programs.
E.g., although it has many drawbacks, I really like the organizational and thorough search capabilities of Outlook, and I've been using it for far too long as my mail filer at home to think about conversion. Having all the data in one place is too convenient. (I.e., I'm lazy in that regard.)
There is no use keeping everything, as most of it will be useless to linux.
Just the programs. The data is still needed.
Is there some room on the drive for an extra partition? You could create a fat32 partition large enough to hold the data you
want
to keep, and dump the rest.
Ick - again, no real need as long as I don't actually run Windows on the hardware directly any more.
Thanks.