[solved] CentOS 7 disk/partition problem after disk "change"

Discussion in 'Technical' started by Tomislav Aurednik, Mar 3, 2017.

  1. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    I had a CentOS install with 2 disks. SSD(sda) for boot, swap and root. HDD(sdb) for data mounted in /hdd. All partitions except boot are lvm.
    I "replaced" the disk with a bigger one (deleted smart array for raid1 with 2xHDD and created a raid5 3xHDD smart array).
    Tryed creating a sdb1 (lvm) partition with GParted live (8TB partition) but it won't let me.
    Now after reboot I get booted in maintenance mode.
    How and where can I delete the old records for the sdb1 partiton and create the new partitons? Or how does one fix this problem?
    The only record I found of the old partition is the record in fstab.
     
  2. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    Tryed with parted but it still won't create partition.
    Disk /dev/sdb: 8001.5 GB, 8001506074624 bytes, 15627941552 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 262144 bytes / 524288 bytes
    Disk label type: gpt


    # Start End Size Type Name
    [root@server2 ~]# parted /dev/sdb
    GNU Parted 3.1
    Using /dev/sdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) mklabel gpt
    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
    (parted) unit TB
    (parted) mkpart primary 0 0
    (parted) mkpart primary 0.00TB 8.00TB
    Warning: You requested a partition from 0.00TB to 8.00TB (sectors 0..15625000000).
    The closest location we can manage is 0.00TB to 0.00TB (sectors 34..2047).

    the parted print command output:
    [root@server2 ~]# parted /dev/sdb
    GNU Parted 3.1
    Using /dev/sdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) print
    Model: HP LOGICAL VOLUME (scsi)
    Disk /dev/sdb: 8002GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Disk Flags:

    Number Start End Size File system Name Flags
    1 1049kB 2097kB 1049kB primary
     
    Last edited: Mar 6, 2017
  3. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    needed to run
    dd if=/dev/zero of=/dev/sdb bs=512 count=1 conv=notrunc
    after I could create the partition with no problem!
     

Share This Page