How to make BIG partitions in linux

Your cannot create partitions larger then 4Tb using fdisk.
Your should use parted and gpt as partition type.

  # parted /dev/sdb
  (parted)
select /dev/sdb                                                  
  Using /dev/sdb
  (parted)
mklabel                                                       
  Warning: The existing disk label on /dev/sdb will be destroyed and all
data on this  disk will be
  lost. Do you want to continue?
  Yes/No?
yes                                                               
  New disk label type?  [msdos]?
gpt                                        
  (parted) mkpart primary 0
100%                                            
  (parted)
quit                                                             
Information: You may need to
update /etc/fstab.                           

Let`s check, what we have now:

  dell2950x08:~# parted /dev/sdb
  (parted) select /dev/sdb
  Using /dev/sdb
  (parted)
print                                                            
  Model: RaidWeb. Com (scsi)
  Disk /dev/sdb: 20.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt
  
  Number  Start   End     Size    File system  Name     Flags
   1      17.4kB  20.0TB  20.0TB               primary       

Now build xfs filesystem. Because ext3,ext4,reiserfs – 32-x bit and
have 16 Tb limitation per volume.

  mkfs.xfs  -b size=4096   /dev/sdb1 

Now let`s mount to vserver. (This way is recommended by vserver developers, but it`s not good…)

This part is a little bit deprecated we use lxc now. And I can recommend migration to lxc at all progects.

 vnamespace --enter dw1 -- mount -t xfs -o
inode64,noatime /dev/sdb1 /var/lib/vservers/dw1/spool1/

df will show wrong data due to absence of partition at mtab of physical server.

Correct way – add to vserver fstab and do
vserver restart

Then df at vserver env. will show correct space data.
Bye! And sorry if it was obvious and trivial :).

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>