Converting ext3 to ext4 filesystem

Here is a little tip which might help people to do the required thing to get the job done. As the title of this post said..will outline the procedure for that.

Here we go..


bhaskar@GentooLinux_10:50:09_Thu Mar 28:~> sudo blkid
Password:
/dev/sda1: LABEL="ARCH" UUID="9db5a364-ee86-4c57-8252-bfff8581e4b6" TYPE="ext4"
/dev/sda2: LABEL="Fedora-boot" UUID="ff94a6b0-3eee-4dc9-83e0-cbde449e93d7" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda3: UUID="kiCF1K-xTxV-t2Yu-CrBX-oENB-1kSn-6UY4Va" TYPE="LVM2_member"
/dev/sda5: UUID="X2MDAl-EaD9-s0kY-FbpZ-X6Wo-GowQ-yvTu1z" TYPE="LVM2_member"
/dev/sda6: LABEL="Fedora" UUID="7945ae6e-7061-4153-a5a1-ab9f60f693ae" TYPE="ext4"
/dev/sda7: UUID="61147c93-cf06-4d45-8204-b79b5b5d19a4" TYPE="swap"
/dev/sda8: LABEL="Slackware" UUID="77de30c7-fb6a-42d8-9cc3-7bd29e2cba06" TYPE="ext4"
/dev/sda9: LABEL="Gentoo" UUID="d83b45ce-ce1c-4678-9663-b884bab6f5cb" TYPE="ext4"
/dev/sda10: LABEL="Debian" UUID="1c0feb69-e586-4b2a-b774-176066a12e00" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda11: LABEL="ScientificLinux" UUID="7dedb9fe-8d77-4c93-bdbd-3297281041be" TYPE="ext4"
/dev/sda12: LABEL="openSUSE" UUID="924f28b3-8cda-4d7e-a833-c7687580e113" TYPE="ext4"
/dev/sda13: UUID="1Ke3cG-vv1Y-vgi6-Sszr-r3nz-xbQx-QzFyp1" TYPE="LVM2_member"
/dev/mapper/home-home: UUID="9fa403bf-858d-4ce2-9b5e-03bdeb2e9406" TYPE="ext3"
/dev/mapper/data-lvmdata: UUID="569e992f-3782-4689-8abf-85b59af4ba17" TYPE="ext3"
bhaskar@GentooLinux_11:58:30_Thu Mar 28:~> cat convert_to_ext4
tune2fs -O extents,uninit_bg,dir_index /dev/dev-name

For example convert /dev/sdb1 to ext4, enter:
# cd /; umount /dev/sdb1
# tune2fs -O extents,uninit_bg,dir_index /dev/sdb1
Next run fsck, enter:
# fsck -pf /dev/sdb1
a10skar@GentooLinux_11:58:38_Thu Mar 28:~> sudo tune2fs -O extents,uninit_bg,dir_index /dev/sda10
tune2fs 1.42 (29-Nov-2011)
bhaskar@GentooLinux_11:59:18_Thu Mar 28:~> fsck -pf /dev/sda10
bash: fsck: command not found
bhaskar@GentooLinux_11:59:36_Thu Mar 28:~> whereis fsck
fsck: /sbin/fsck.cramfs /sbin/fsck.minix /sbin/fsck.ext2 /sbin/fsck.ext4dev /sbin/fsck.ext4 /sbin/fsck.ext3 /sbin/fsck /usr/share/man/man8/fsck.8.bz2
bhaskar@GentooLinux_11:59:42_Thu Mar 28:~> sudo /sbin/fsck -pf /dev/sda10
fsck from util-linux 2.21.2
Debian: 261230/1220608 files (1.1% non-contiguous), 1666171/4882432 blockssudo blkid
/dev/sda1: LABEL="ARCH" UUID="9db5a364-ee86-4c57-8252-bfff8581e4b6" TYPE="ext4"
/dev/sda2: LABEL="Fedora-boot" UUID="ff94a6b0-3eee-4dc9-83e0-cbde449e93d7" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda3: UUID="kiCF1K-xTxV-t2Yu-CrBX-oENB-1kSn-6UY4Va" TYPE="LVM2_member"
/dev/sda5: UUID="X2MDAl-EaD9-s0kY-FbpZ-X6Wo-GowQ-yvTu1z" TYPE="LVM2_member"
/dev/sda6: LABEL="Fedora" UUID="7945ae6e-7061-4153-a5a1-ab9f60f693ae" TYPE="ext4"
/dev/sda7: UUID="61147c93-cf06-4d45-8204-b79b5b5d19a4" TYPE="swap"
/dev/sda8: LABEL="Slackware" UUID="77de30c7-fb6a-42d8-9cc3-7bd29e2cba06" TYPE="ext4"
/dev/sda9: LABEL="Gentoo" UUID="d83b45ce-ce1c-4678-9663-b884bab6f5cb" TYPE="ext4"
/dev/sda10: LABEL="Debian" UUID="1c0feb69-e586-4b2a-b774-176066a12e00" TYPE="ext4"
/dev/sda11: LABEL="ScientificLinux" UUID="7dedb9fe-8d77-4c93-bdbd-3297281041be" TYPE="ext4"
/dev/sda12: LABEL="openSUSE" UUID="924f28b3-8cda-4d7e-a833-c7687580e113" TYPE="ext4"
/dev/sda13: UUID="1Ke3cG-vv1Y-vgi6-Sszr-r3nz-xbQx-QzFyp1" TYPE="LVM2_member"
/dev/mapper/home-home: UUID="9fa403bf-858d-4ce2-9b5e-03bdeb2e9406" TYPE="ext3"
/dev/mapper/data-lvmdata: UUID="569e992f-3782-4689-8abf-85b59af4ba17" TYPE="ext3"

In the many partition I have changed the “Debian” partition from ext3 to ext4.Next time you get into that specific drive …please check the file /proc/filesystems …and it should enlist ext4 in it.

Hope this will help.

Cheers!
Bhaskar

About these ads

About unixbhaskar
Sr Consultant GNU/Linux and Networking

One Response to Converting ext3 to ext4 filesystem

  1. Pingback: Links 31/3/2013: Linux 3.8.5 Out, B0ng Bias Against Ubuntu | Techrights

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93 other followers

%d bloggers like this: