- Linux : Partition and format external hard drive as ext3 filesystem
- About Kaven Gagnon
- What is Ext2, Ext3 & Ext4 and How to Create and Convert Linux File Systems
- Ext2 – Second Extended File System
- Ext3 – Third Extended File System
- Ext4 – Fourth Extended File System
- How to Determine File System Type?
- Creating an Ext2, or Ext3, or Ext4 File Systems
- Creating a Ext2 File System
- Creating a Ext3 File System
- Creating the Ext4 File System
- Converting an Ext2, or Ext3, or Ext4 File Systems
- Converting Ext2 to Ext3
- Converting Ext2 to Ext4
- Converting Ext3 to Ext4
- Linux Windows Install Setup Configuration Project
- Format Linux partition ext3 on Linux Fedora USB hard disk
- Step by Step Format Linux partition ext3 on Linux Fedora USB hard disk
- Format Linux Partition.
Linux : Partition and format external hard drive as ext3 filesystem
This tutorial is about partitioning a USB external hard drive as good for internal drive.
First, list devices on your system using one of the following commands :
(USB drive should appear as SCSI drive)
Now, assuming your new drive is “sdb”, use the following command to invoke the fdisk partition utility :
To create a new partition (assuming this is a new unused drive), just type “n“. Then, save your work typing “w” and “q” to exit the utility.
Any doubt or need help about fdisk utility, just type “m“.
Let’s format the partition as traditional EXT3 Linux file system :
Okay, the hard disk partitioning and formatting is done now.
Create a directory where you want to have your drive mounted (replace all “external_hd” value with the name you want to use ) :
You’re now ready to use it! However, this mount will not survive to a reboot. To make it permanent, you need to edit fstab :
And add the following line :
NOTE : If you manually mount the drive instead doing the fstab way, do not forget to manually unmount it before unplug it! Serious data loss problem may occur if you skip this step!
About Kaven Gagnon
System & Network Architect
Unquoted Windows search path vulnerability in the Foxit Cloud Safe Update Service in the Cloud plugin in Foxit Reader 6.1 through 7.0.6.1126 allows local users to gain privileges via a Trojan horse program in the %SYSTEMDRIVE% folder. (CVSS:4.4) (Last Update:2016-12-03)
Foxit Reader, Enterprise Reader, and PhantomPDF before 7.1 allow remote attackers to cause a denial of service (memory corruption and crash) via a crafted (1) Ubyte Size in a DataSubBlock structure or (2) LZWMinimumCodeSize in a GIF image. (CVSS:4.3) (Last Update:2016-12-03)
Cross-site request forgery (CSRF) vulnerability in CS-Cart 4.2.4 allows remote attackers to hijack the authentication of users for requests that change a user password via a request to profiles-update/. (CVSS:6.8) (Last Update:2016-12-03)
What is Ext2, Ext3 & Ext4 and How to Create and Convert Linux File Systems
I have used my Fedora old system to test where I converted from ext2 to ext3, ext2 to ext4, and ext3 to ext4 file systems successfully.
By following this guide anyone can convert their file systems smartly, but still, I like to WARN you all before doing this because the following task required skilled administrative practices, and make sure you must take the important backup of your files before doing this. If in case something goes wrong at least you can revert to back with your backup data.
In a computer, a file system is a way in which files are named and placed logically to store, retrieve, and update the data and also used to manage space on the available devices.
The file system is divided into two segments called User Data and Metadata. In this article, I am trying to explore how to create and convert various Linux file systems and high-level differences amongst Ext2, Ext3, and Ext4 file systems.
Before moving further readings, let me introduce a brief about Linux file systems.
Ext2 – Second Extended File System
- The ext2 file system was introduced in 1993 and Ext2 was developed by Remy Card. It was the first default file system in several Linux distros like RedHat and Debian.
- It was to overcome the limitation of the legacy Ext file system.
- Maximum file size is 16GB – 2TB.
- The journaling feature is not available.
- It’s being used for normally Flash-based storage media like USB Flash drive, SD Card, etc.
Ext3 – Third Extended File System
- Ext3 file system was introduced in 2001 and the same was integrated with Kernel 2.4.15 with a journaling feature, which is to improve reliability and eliminates the need to check the file system after an unclean shutdown.
- Max file size 16GB – 2TB.
- Provide facility to upgrade from Ext2 to Ext3 file systems without having to back up and restore data.
Ext4 – Fourth Extended File System
- Ext4, the high-anticipated Ext3 successor.
- In October 2008, Ext4 as stable code was merged in Kernel 2.6.28 which contains an Ext4 file system.
- Backward compatibility.
- Max file size 16GB to 16TB.
- The ext4 file system has the option to Turn Off the journaling feature.
- Other features like Sub Directory Scalability, Multiblock Allocation, Delayed Allocation, Fast FSCK etc.
How to Determine File System Type?
To determine your Linux file system type, run the following command in the terminal as a root user.
# df -hT | awk '' | grep "^/dev" /dev/sda3 ext3 / /dev/sda1 ext3 /boot
Creating an Ext2, or Ext3, or Ext4 File Systems
Once you create a file system using fdisk or parted command, use mke2fs command to create either of the file system and make sure you replace hdXX with your device name.
Creating a Ext2 File System
Creating a Ext3 File System
# mke2fs –j /dev/hdXX OR # mkfs.ext3 /dev/hdXX
-j option is used for journaling.
Creating the Ext4 File System
# mke2fs -t ext4 /dev/hdXX OR # mkfs.ext4 /dev/hdXX
-t option to specify the file system type.
Converting an Ext2, or Ext3, or Ext4 File Systems
It is always a better way to unmount the file systems and convert them. Conversion can be done without unmounting and mounting the filesystem. Again replace hdXX with your device name.
Converting Ext2 to Ext3
To change an ext2 file system to ext3 enabling the journal feature, use the command.
Converting Ext2 to Ext4
To convert from old ext2 to new ext4 file system with the latest journaling feature. Run the following command.
# tune2fs -O dir_index,has_journal,uninit_bg /dev/hdXX
Next, do a complete file system check with the e2fsck command to fix and repair.
-p option automatically repairs the file system.
-f option forces checking file system even it seems clean.
Converting Ext3 to Ext4
To enable the ext4 features on an existing ext3 filesystem, use the command.
# tune2fs -O extents,uninit_bg,dir_index /dev/hdXX
WARNING: You cannot revert or mount back to the ext3 filesystem once you run the above command.
After running this command we MUST run fsck to fix up some on-disk structures that tune2fs have modified.
WARNING: Please try all these above commands on your testing Linux server.
Linux Windows Install Setup Configuration Project
Format Linux partition ext3 on Linux Fedora USB hard disk
Step by Step Format Linux partition ext3 on Linux Fedora USB hard disk
T o use any new hard disk device on Linux Fedora system, the hard disk device need to have a filesystem. In order to put the filesystem on new hard disk, you need to create partition on hard disk and then format the hard disk with the Linux filesystem ext3 or Windows filesystem type (vfat). After the partitioning and formatting, then disk is ready to be use. The step by step article below show how to format the external USB disk and build the ext3 Linux file system on the disk. Note that the procedure to make or format Linux ext3 partition below is executed and tested on Linux Fedora 10.
Format Linux Partition.
The mkfs command is use to make or format ext3 partition as show on the example below. The example below show two ways or two mkfs command that you can use to make or format the ext3 partition:
1. first command: mkfs -t ext3 -v -L usbdisk /dev/sdb1 -> the (-t) for filesystem type, the (-v) verbose output, the (-L) for filesystem label.
2. Second command: mkfs.ext3 -v -L usbdisk /dev/sdb1 -> the (-v) verbose output, the (-L) for filesystem label.
Note: Only use either one of the fdisk command above to make the ext3 partition.
Using mkfs command to format Linux partition: mkfs -t ext3 -v -L usbdisk /dev/sdb1
[root@fedora ~]# mkfs -t ext3 -v -L usbdisk /dev/sdb1
fs_types for mke2fs.conf resolution: ‘ext3’, ‘default’
2444624 inodes, 9767420 blocks
488371 blocks (5.00%) reserved for the super user
Maximum filesystem blocks=0
32768 blocks per group, 32768 fragments per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
or use mkfs.ext3 command to format Linux partition: mkfs.ext3 -v -L usbdisk /dev/sdb1
[root@fedora ~]# mkfs.ext3 -v -L usbdisk /dev/sdb1
fs_types for mke2fs.conf resolution: ‘ext3’, ‘default’
2444624 inodes, 9767420 blocks
488371 blocks (5.00%) reserved for the super user
Maximum filesystem blocks=0
32768 blocks per group, 32768 fragments per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Keywords: format linux partition, format fedora partition, fedora format partition, format ext3 partition, using mkfs, using mkfs.ext3, format linux