Walker News

Problem Of Using Linux EXT3 Filesystem On Hard Disk Without Partition

What is the problem or risk if you create Linux ext3 filesystem on entire hard disk that is not initialized with a partition table?

In the following test using RHEL 5.2 on VMware virtual machine, I can’t mount the filesystem using “filesystem volume name” (a.k.a. volume label) as the ext3 filesystem is not created on a partition, i.e. it is created on the second SCSI disk directly:

Indicate there is no partition table found:
fdisk -l /dev/sdb

Proceed to create ext3 filesystem with volume label “/newfs” on the hard disk without partition:
mkfs -t ext3 -L /newfs -v /dev/sdb

Now is time to mount the new ext3 filesystem and this particular command completes successfully:
mount -t ext3 /dev/sdb /newfs

So, execute umount /newfs and run mount command using volume label fashion – this time, it fails as mount program cannot find the special device “LABEL=/newfs”:
mount -t ext3 LABEL=/newfs /newfs

Therefore, it is better to create ext3 filesystem on partition, not on hard disk directly, unless there is an obvious benefit or reason to do so.

If the second SCSI hard disk was initialized with single, primary Linux partition prior to execute mkfs command, there will be no such problem, i.e.:
  1. Execute fdisk /dev/sdb, answer “n” to add new partition, “p” for primary partition, “1” for partition number 1, press ENTER twice to accept default value (effectively allocate entire hard disk for the primary partition), “w” to create the partition table.
     
  2. Run mkfs -t ext3 -L /newfs -v /dev/sdb1 to create ext3 filesystem on the primary partition (/dev/sdb1).

Now, either one of these two mount commands will work without error:
mount -t ext3 /dev/sdb1 /newfs
mount -t ext3 LABEL=/newfs /newfs

After append this line to /etc/fstab:
LABEL=/newfs   /newfs   ext3   defaults   1   2

Then Linux will auto mount this new filesystem on each reboot or you can also run mount /newfs at root command prompt.

Custom Search

2016  •  Privacy Policy