Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I read on the arch wiki that it is not recommended to partition a disk before creating the ZFS filesystem on it. I searched but did not find any such statement about ext4. So my question is: can I put a ext4 filesystem on a disk to be used for storage (so not root partition of the system) without partitioning it? What are the drawbacks?

share|improve this question

4 Answers 4

Not required, but you should partition. The partition table eats up very little space, but it is universally recognizable. Windows will know that there's a filesystem there if you put it in a Windows box. If you have no partitions, other operating systems will just treat it as an empty drive.

share|improve this answer

You can run any filesystem on a bare block device with or without partitions, however the danger is that both people and OSes expect to see a partition table on a block device to realize that there is data present.

(both raw disks and partitions are just block devices, after all)

ZFS actually creates such a guardian partition table which is why it's safe to do use it on an unpartitioned device:

$ zpool status
...
    NAME        STATE     READ WRITE CKSUM
    storage     ONLINE       0     0     0
      raidz2-0  ONLINE       0     0     0
        sda     ONLINE       0     0     0
        sdb     ONLINE       0     0     0
            ...

$ sudo gdisk -l /dev/sda
...
  MBR: protective
  GPT: present
...
Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      7814019071   3.6 TiB     BF01  zfs
   9      7814019072      7814035455   8.0 MiB     BF07  
share|improve this answer

Yes you can format a whole block device and need not create a partition first.

On SAN LUNs and multi-boot systems I would recommend creating partitions though and setting the correct filesystem id, as you run the risk that other operating systems and/or operators could interpret a unpartitioned disk as free and unused.

share|improve this answer
    
The storage team here usually presents additional LUNs rather resizing them so we don't have the disadvantage that to resize a partition needs to be unmounted... –  HBruijn Nov 28 '13 at 16:10

With OS disk you need to partition the disk, because boot loader read the partition table, but with data disk you don't need disk partition, but i recommend to use lvm with ext4, because maybe in a future your space will be gone

share|improve this answer
    
what is bed in this answer? –  c4f4t0r Nov 28 '13 at 17:53
    
tulips to the power of roses –  MikeyB Nov 28 '13 at 17:58
    
It doesn't make all that much sense. I can't tell what you're trying to say in the last sentence, even. –  Falcon Momot Nov 28 '13 at 17:58
    
what you don't understand? –  c4f4t0r Nov 28 '13 at 18:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.