Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: What will be an easy way to format 4TB hard drive

  1. #11
    Join Date
    Apr 2006
    Beans
    2,636

    Re: What will be an easy way to format 4TB hard drive

    Hi all,

    Problem solved as follow;

    Steps
    1) install gparted

    2) format 4TB WD drive according to following articles;
    How to Format a Hard Drive Using Ubuntu
    https://www.wikihow.com/Format-a-Har...e-Using-Ubuntu
    Method-2 Using GParted

    # fdisk -l
    Code:
    Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: 343B80D3-E9CF-4B72-B4FF-2D311BA603E3
    
    Device     Start        End    Sectors  Size Type
    /dev/sda1   2048 7814035455 7814033408  3.7T Linux filesystem
    
    Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: F3A8D40E-D988-4EF7-8FB7-B1F978474D92
    
    Device       Start       End   Sectors   Size Type
    /dev/sdb1     2048   1050623   1048576   512M EFI System
    /dev/sdb2  1050624 976771071 975720448 465.3G Linux LVM
    
    Disk /dev/mapper/ubuntu--vg-root: 464.3 GiB, 498539167744 bytes, 973709312 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    Disk /dev/mapper/ubuntu--vg-swap_1: 980 MiB, 1027604480 bytes, 2007040 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Lot of thanks for your advice.

    Regards
    satimis


    Regards
    satimis

  2. #12
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    19,231
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: What will be an easy way to format 4TB hard drive

    That's 1-way.

    Had you used LVM, then 1 partition, 1 pv, 1 vg, and any number of LVs could be used. With LVM, moving all this data to other disk could be trivial. LVM also provides nice ways to handle backups via snapshots. Without LVM, you've just given up on that. If the OS disk wasn't using LVM already, I wouldn't have written anything. The system is already using LVM and already has the slightly added complication. Not using it on new storage is a not-so-great idea, IMHO.

    Haven't heard any mention of backups. What's that plan?

  3. #13
    Join Date
    Apr 2006
    Beans
    2,636

    Re: What will be an easy way to format 4TB hard drive

    Quote Originally Posted by TheFu View Post
    That's 1-way.

    Had you used LVM, then 1 partition, 1 pv, 1 vg, and any number of LVs could be used. With LVM, moving all this data to other disk could be trivial. LVM also provides nice ways to handle backups via snapshots. Without LVM, you've just given up on that. If the OS disk wasn't using LVM already, I wouldn't have written anything. The system is already using LVM and already has the slightly added complication. Not using it on new storage is a not-so-great idea, IMHO.

    Haven't heard any mention of backups. What's that plan?
    Hi,

    I'll perform another test using the 500G Samsung SSD for data storage, creating LVM partition on it. The same is now running Ubuntu 18.04 and I'll erase it.

    This PC is originally having a m.2 pcie 1TB SSD running Ubuntu 18.04 desktop.

    # fdisk -1
    Code:
    ....
    Disk /dev/nvme0n1: 953.9 GiB, 1024209543168 bytes, 2000409264 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: 271E9246-CC54-4368-8693-FDCC3EE8AB23
    
    Device           Start        End    Sectors   Size Type
    /dev/nvme0n1p1    2048    1050623    1048576   512M EFI System
    /dev/nvme0n1p2 1050624 2000408575 1999357952 953.4G Linux LVM
    
    
    Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: 343B80D3-E9CF-4B72-B4FF-2D311BA603E3
    
    Device     Start        End    Sectors  Size Type
    /dev/sda1   2048 7814035455 7814033408  3.7T Linux filesystem
    Please shed me some light how to proceed installing the LVM partition on the 500G Samsung SSD.

    I don't keep backup. I have an external 2TB WD drive keeping a duplicate copy of all data on the internal storage drive.

    Regards
    satimis

  4. #14
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,450

    Re: What will be an easy way to format 4TB hard drive

    Please shed me some light how to proceed installing the LVM partition on the 500G Samsung SSD.
    Shedding a bit of light: It's the same procedure as with the 4 tB drive, except when creating a partition using gparted, choose "Format as: LVM2 "
    Also, before creating the LVM partition: if you plan to install an operating system, be sure to create a standard EFI system partition - usually as the first partition.

    Then you use terminal commands after that for creating a VG (volume group) and its LVs (logical volumes).
    If you are not familiar with basic LVM management commands, you need to learn those.
    I used this tutorial as my first guide to LVM and its necessary management commands.
    http://www.tutonics.com/2012/11/ubun...de-part-1.html
    Spend some time with it. Luckily it's still online! (Guide is apparently from 2012, but still good. It shows MSDOS partitioning - now we use GPT instead. But information on the management commands is still correct.)
    Last edited by Dennis N; December 15th, 2019 at 05:42 PM.

  5. #15
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    19,231
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: What will be an easy way to format 4TB hard drive

    The link I posted above has my LVM layout. The base partitions and LVs are good for an UEFI boot setup. That disk is 500GB. The /boot/, /boot/efi/ partitions and / LV is sized correctly. All the other LVs are a matter of need, as described in the link.

    Using LVM is about what you don't know tomorrow, not what you think you know about today.

    There are tutorials for LVM. Why did you choose it for the main OS if you didn't know about LVM already?
    As already said,
    Had you used LVM, then 1 partition, 1 pv, 1 vg, and any number of LVs could be used.
    A PV, Physical Volume, is 1-for-1 a partition.
    A VG, Volume Group, is made of of 1 or more PVs.
    LVs, Logical Volumes, are allocated/sized from a VG. For day to day considerations, an LV is the same as a partition. An LV gets formatted with a file system. An LV is the unit where snapshots (lvm snapshots) are made. When a snapshot is created, there must be sufficient storage in the VG to hold any data that changes for the life-time of the snapshot.

    So with a 4tb PV/partition, I would use pvcreate, vgcreate, and lvcreate to make the PV, VG, then initial LV.
    The most important part of using LVM is that increasing the size of any LV is trivial, reducing the size is a hassle. A few of my rules:
    * NEVER over-size/allocate an LV beyond what you can backup.
    * Never have a VG span more than 1 physical disk, unless you have perfect backups or don't mind total data loss in the VG if 1 disk fails.
    * Always leave plenty of storage for snapshots.

    If the 2TB is for backups, then I wouldn't make the data LV on the 4TB disk over about 1.8TB in size. Use the rest of the storage in a separate LV as scratch space. Nothing wrong with scratch space, provided it disappearing in 5 minutes is ok. Any disk can fail at any point.

    For LVM knowledge, work through an LVM tutorial. Before you've done anything else with the new disk is the best time to play. Just be certain you don't accidentally play using the OS VG, LVs. That could easily be bad. Though you might enjoy using pvmove for fun.

    What commands are part of LVM? Use tab completion to discover some:
    pv{tab}{tab}
    vg{tab}{tab}
    lv{tab}{tab}
    For example:
    Code:
    $ vg{tab}{tab}
    vgcfgbackup    vgconvert      vgextend       vgmknodes      vgs
    vgcfgrestore   vgcreate       vgimport       vgreduce       vgscan
    vgchange       vgdisplay      vgimportclone  vgremove       vgsplit
    vgck           vgexport       vgmerge        vgrename
    For an overview of all LVM storage on a system, use:
    Code:
    sudo pvs
    sudo vgs
    sudo lvs
    There aren't any GUI tools for LVM. Pretty much any tutorial from any Linux found using any search engine will be fine. LVM is LVM is LVM regardless of the distro or release. Basic use only uses a few of those commands.

  6. #16
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    19,231
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: What will be an easy way to format 4TB hard drive

    Formatted a few LVs on an 8TB, usb3 connected, disk today.
    Code:
    $ time sudo mkfs -t ext4 /dev/mapper/istar--8TB--vg5-istar--lv5 
    mke2fs 1.42.13 (17-May-2015)
    Creating filesystem with 805306368 4k blocks and 201326592 inodes
    Filesystem UUID: 7dc085ef-9b09-4dea-ba91-dd60f10e7417
    Superblock backups stored on blocks: 
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
            102400000, 214990848, 512000000, 550731776, 644972544
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done       
    
    real    0m4.398s
    user    0m0.144s
    sys     0m0.224s
    
    lsblk  .... 
    sdg                                   7.3T disk             
    ├─sdg1                                3.7T part LVM2_member 
    │ └─istar--8TB--vg4-istar--lv4          3T lvm  ext4        
    └─sdg2                                3.7T part LVM2_member 
      └─istar--8TB--vg5-istar--lv5          3T lvm  ext4
    Wall clock time was under 5 seconds. The system involved is my lowest-end, 5+ yr old, dual-core Pentium box.
    I've only allocated 3TB per LV. Room to grow, room for snapshots, and for future unknown needs.
    The 2nd LV took about the same wall time.

    Anyways, the point is that formatting almost any size ext4 file system on an LV managed by LVM is a trivial operation. If it isn't this fast there, I think something else is wrong.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •