Announcement

Collapse
No announcement yet.

Two Disk Install instructions Updated - System on SSD, data on HDD

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Two Disk Install instructions Updated - System on SSD, data on HDD

    In another thread (https://www.vortexbox.org/forum/main...newer-releases) there was a discussion on upgrading the version of Fedora on a working Vortexbox.
    I upgraded a test box to Fedora 25 then before going to Fedora 27 used Clonezilla to copy of the SSD in case it all went pear shaped.

    It didn't.
    So I now had a cheap SSD with a working Vortexbox image installed. Last week Intel released new cpu's - Coffee Lake - so the local computer stores started selling last years superseded stock at a discount.

    I bought on sale a MSI H110M micro ATX motherboard, Pentium G4560 and ram and hooked them up using the SSD.replacing the motherboard in an old no longer working computer from under the house.

    For disk storage I had a 4TB drive and two 2TB drives in the spares cupboard, so I proceeded to build a new "Two Disk Install" using the old instructions. These instructions are well out of date, so I brought them up to date in a .rtf document.

    I documented the Two Disk Install using the 4TB disk and one 2TB disk as storage. VB 2.4 Two Disk Install.zip

    I then updated the Expand Storage howto as I added the second 2TB disk and will post as a separate topic

  • #2
    I get an error when I try to access the VB 2.4 Two Disk Install.zip link

    Comment


    • #3
      Sorry about that, it appears that attachments don't work, neither do large posts, so I will post the procedure in chunks.
      Part one.

      Two Disk Install via command line.

      This assumes that you have setup Putty
      https://wiki.vortexbox.org/troublesh...a_command_line
      In reading this how-to, [[email protected] ~]# is the command line prompt from my system.
      I have used a lot of display commands to show status both before and after a change command is given. Also, the disks were previously used in Windows and Linux systems and occasionally threw warnings when changes were being made.

      step 1 - install vortexbox to small drive (ssd) according to https://wiki.vortexbox.org/
      but don't do:
      config_local_storage.sh
      reboot

      step 2 - physically install the large second drive for /storage
      In this case I have the system on the cheapest 120Gb SSD I could buy.
      I have also a 4TB and two 2TB disks for a total of 8TB of storage.
      I will setup the 4TB + 2TB first then add the 2TB disk as a separate exercise.

      step 3 - boot vortexbox, login via Putty (ssh) and create a partition table on the new drive

      List the drives using fdisk -l (lower case L, not 1)

      [
      Code:
      [email protected] ~]# fdisk -l
      
      Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 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: DA1C7E00-7FA7-44DD-8069-B0C56E59AE0F
      
      Device Start End Sectors Size Type
      /dev/sda1 2048 4095 2048 1M BIOS boot
      /dev/sda2 4096 618495 614400 300M Linux filesystem
      /dev/sda3 618496 1667071 1048576 512M Linux swap
      /dev/sda4 1667072 64581631 62914560 30G Linux filesystem
      
      Disk /dev/sdb: 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
      
      Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 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/sdd: 1.8 TiB, 2000398934016 bytes, 3907029168 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
      
      [[email protected] ~]#

      Comment


      • #4
        Part 2

        /dev/sdb is the 4TB drive where we will start by creating a partition table.
        So we start fdisk, display the help, display the partition table, create a GPT partition table, display the partition table again to confirm we can use the whole disk, create a new partition and display the partition table and if it appears correct, write it.


        Code:
        [[email protected] ~]# fdisk /dev/sdb
        
        Welcome to fdisk (util-linux 2.28.2).
        Changes will remain in memory only, until you decide to write them.
        Be careful before using the write command.
        
        Device does not contain a recognized partition table.
        The size of this disk is 3.7 TiB (4000787030016 bytes). DOS partition table format can not be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).
        
        Created a new DOS disklabel with disk identifier 0xf7a00210.
        
        Command (m for help): m
        
        Help:
        
          DOS (MBR)
           a   toggle a bootable flag
           b   edit nested BSD disklabel
           c   toggle the dos compatibility flag
        
          Generic
           d   delete a partition
           F   list free unpartitioned space
           l   list known partition types
           n   add a new partition
           p   print the partition table
           t   change a partition type
           v   verify the partition table
           i   print information about a partition
        
          Misc
           m   print this menu
           u   change display/entry units
           x   extra functionality (experts only)
        
          Script
           I   load disk layout from sfdisk script file
           O   dump disk layout to sfdisk script file
        
          Save & Exit
           w   write table to disk and exit
           q   quit without saving changes
        
          Create a new label
           g   create a new empty GPT partition table
           G   create a new empty SGI (IRIX) partition table
           o   create a new empty DOS partition table
           s   create a new empty Sun partition table
        
        
        Command (m for help): p
        Disk /dev/sdb: 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: dos
        Disk identifier: 0xf7a00210
        
        Command (m for help): g
        Created a new GPT disklabel (GUID: F974EF6C-3803-4E3A-8AE2-64CD6BC2AD04).
        
        Command (m for help): p
        Disk /dev/sdb: 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: F974EF6C-3803-4E3A-8AE2-64CD6BC2AD04
        
        Command (m for help): n
        Partition number (1-128, default 1):
        First sector (2048-7814037134, default 2048):
        Last sector, +sectors or +size{K,M,G,T,P} (2048-7814037134, default 7814037134):
        
        Created a new partition 1 of type 'Linux filesystem' and of size 3.7 TiB.
        
        Command (m for help): p
        Disk /dev/sdb: 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: F974EF6C-3803-4E3A-8AE2-64CD6BC2AD04
        
        Device     Start        End    Sectors  Size Type
        /dev/sdb1   2048 7814037134 7814035087  3.7T Linux filesystem
        
        Command (m for help): w
        The partition table has been altered.
        Calling ioctl() to re-read partition table.
        Syncing disks.
        
        [[email protected] ~]#

        Comment


        • #5
          Part 3

          Okay, now we are going to setup the first of the 2TB drives.
          Code:
          [[email protected] ~]# fdisk /dev/sdc
          
          Welcome to fdisk (util-linux 2.28.2).
          Changes will remain in memory only, until you decide to write them.
          Be careful before using the write command.
          
          Device does not contain a recognized partition table.
          Created a new DOS disklabel with disk identifier 0x56116c8d.
          
          Command (m for help): g
          Created a new GPT disklabel (GUID: 6B412C08-C76D-4AA3-9687-BF96B7212F0E).
          
          Command (m for help): n
          Partition number (1-128, default 1):
          First sector (2048-3907029134, default 2048):
          Last sector, +sectors or +size{K,M,G,T,P} (2048-3907029134, default 3907029134):
          
          Created a new partition 1 of type 'Linux filesystem' and of size 1.8 TiB.
          
          Command (m for help): p
          Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 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: 6B412C08-C76D-4AA3-9687-BF96B7212F0E
          
          Device     Start        End    Sectors  Size Type
          /dev/sdc1   2048 3907029134 3907027087  1.8T Linux filesystem
          
          Command (m for help): w
          The partition table has been altered.
          Calling ioctl() to re-read partition table.
          Syncing disks.
          
          [[email protected] ~]#

          Comment


          • #6
            Part 4

            step 4 - create physical volume for storage.

            Code:
            [[email protected] ~]# pvcreate /dev/sdb1 /dev/sdc1
            
            WARNING: ntfs signature detected on /dev/sdc1 at offset 3. Wipe it? [y/n]: y
              Wiping ntfs signature on /dev/sdc1.
            WARNING: dos signature detected on /dev/sdc1 at offset 510. Wipe it? [y/n]: y
              Wiping dos signature on /dev/sdc1.
              Physical volume "/dev/sdb1" successfully created.
              Physical volume "/dev/sdc1" successfully created.
            
            [[email protected] ~]# pvdisplay
              "/dev/sdb1" is a new physical volume of "3.64 TiB"
              --- NEW Physical volume ---
              PV Name               /dev/sdb1
              VG Name
              PV Size               3.64 TiB
              Allocatable           NO
              PE Size               0
              Total PE              0
              Free PE               0
              Allocated PE          0
              PV UUID               eI8CPg-2U1K-XT3J-Adx1-he2i-Jbdm-XMVyWV
            
              "/dev/sdc1" is a new physical volume of "1.82 TiB"
              --- NEW Physical volume ---
              PV Name               /dev/sdc1
              VG Name
              PV Size               1.82 TiB
              Allocatable           NO
              PE Size               0
              Total PE              0
              Free PE               0
              Allocated PE          0
              PV UUID               A7lAbN-0E4I-6eI6-Qdnf-pbt1-vRqq-jkVoZo
            
            [[email protected] ~]#
            step 5 - create the volume group

            Code:
            [[email protected] ~]# vgcreate -s 32m StorageVM /dev/sdb1 /dev/sdc1
            
              Volume group "StorageVM" successfully created
            
            [[email protected] ~]# vgdisplay
              --- Volume group ---
              VG Name               StorageVM
              System ID
              Format                lvm2
              Metadata Areas        2
              Metadata Sequence No  1
              VG Access             read/write
              VG Status             resizable
              MAX LV                0
              Cur LV                0
              Open LV               0
              Max PV                0
              Cur PV                2
              Act PV                2
              VG Size               5.46 TiB
              PE Size               32.00 MiB
              Total PE              178848
              Alloc PE / Size       0 / 0
              Free  PE / Size       178848 / 5.46 TiB
              VG UUID               mJBTF8-bOWl-zemG-BSd0-65gx-RHuE-fca310
            
            [[email protected] ~]#

            Comment


            • #7
              Part 5

              step 6 - create the logical volume

              [
              Code:
              [email protected] ~]# lvcreate -l100%VG -nlv_storage StorageVM
              
              WARNING: ext4 signature detected on /dev/StorageVM/lv_storage at offset 1080. Wipe it? [y/n]:y
                Wiping ext4 signature on /dev/StorageVM/lv_storage.
                Logical volume "lv_storage" created.
              [[email protected] ~]#
              
              [[email protected] ~]# lvdisplay
              
                --- Logical volume ---
                LV Path                /dev/StorageVM/lv_storage
                LV Name                lv_storage
                VG Name                StorageVM
                LV UUID                jks6OX-vz7P-Dxfo-7qi3-FUyL-REUG-xLq4YG
                LV Write Access        read/write
                LV Creation host, time sugovbox, 2018-04-22 20:36:18 +1000
                LV Status              available
                # open                 0
                LV Size                5.46 TiB
                Current LE             178848
                Segments               2
                Allocation             inherit
                Read ahead sectors     auto
                - currently set to     256
                Block device           253:0
              
              [[email protected] ~]#
              step 7 - create the new filesystem
              * This takes a few minutes (depending on the size and speed of the disks).


              Code:
              [[email protected] ~]# mkfs -t ext4 /dev/StorageVM/lv_storage
              
              mke2fs 1.43.3 (04-Sep-2016)
              Creating filesystem with 1465122816 4k blocks and 183140352 inodes
              Filesystem UUID: 032e8af8-71c4-4eb7-9111-cb7b5dc2df4e
              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 (262144 blocks): done
              Writing superblocks and filesystem accounting information: done
              
              [[email protected] ~]#
              step 8 - move the directories over to the new file system

              Code:
              [[email protected] ~]# mkdir /mnt/temp
              [[email protected] ~]# mount -t ext4 /dev/StorageVM/lv_storage /mnt/temp
              [[email protected] ~]# cd /storage
              [[email protected] storage]# cp -r * /mnt/temp
              [[email protected] storage]#
              step 9 - edit /etc/fstab so the filesystem is mounted at boot time

              Code:
              [[email protected] storage]# nano /etc/fstab
              and add the following line to the end of the file:
              Code:
              /dev/StorageVM/lv_storage       /storage        ext4    defaults        2 2
              Then write the file (control-o) and exit (control-x).

              step 10 - reboot

              Code:
              [[email protected] storage]# reboot
              ================================================== =======================
              References
              https://web.archive.org/web/20150316...twodiskinstall
              https://linuxtechlab.com/beginners-g...me-management/

              If you cock up -
              There is an easy way to erase (wipe) your disk MBR in Linux, using the dd command.
              To format (remove) your MBR & partition table - virtually a "factory restore" but quick as only the front of the disk is clobbered
              Code:
              dd if=/dev/zero of=/dev/sdX bs=512 count=1
              ... where /dev/sdX is the drive you want to remove the MBR & partition table from.
              Last edited by Wirrunna; 04-25-2018, 08:43 PM.

              Comment


              • #8
                Wirrunna,

                This is excellent. Great reference. I will have a crack at this when the new VB comes out.

                I have a NUC with only a single drive so my ultimate objective is to install the OS to a fast USB stick and have the internal drive as storage..

                Comment

                Working...
                X