linux硬盘从一台centos7迁移到centos6的问题记录

一直以为这块硬盘就是一个物理分区,因为之前已经有数据,直接可挂载的,才发现是一个逻辑卷。
比较混乱,也没有整理的意义,没有针对性,只当记录了。

#centos7一块有数据的硬盘向另一台centos6服务器的迁移
#无法mount
mount: you must specify the filesystem type 
yum install parted #
parted -l #查看未挂载的文件系统类型,以及哪些分区尚未格式化

Disk /dev/sdc: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  526MB   524MB   xfs
 3      526MB   8002GB  8001GB                     lvm

 
yum install xfsprogs kmod-xfs xfsdump xfsprogs-devel

yum install lvm2

[root@localhost ~]# pvs
  PV         VG       Fmt  Attr PSize   PFree
  /dev/sda3  VolGroup lvm2 a--u 232.20g    0 
  /dev/sdc3  centos   lvm2 a--u   7.28t 4.00m

lvdisplay

#LV Status     NOT available 激活后挂载即可



   
  --- Logical volume ---
  LV Path                /dev/centos/home
  LV Name                home
  VG Name                centos
  LV UUID                Ulv6ZU-bWj6-0cPh-l8nM-Xkw6-aoMI-SRVgtz
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-19 03:54:34 -0400
  LV Status              NOT available
  LV Size                7.21 TiB
  Current LE             1890779
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  
激活
vgchange -ay /dev/centos/home


Invalid volume group name centos/home.
Run `vgchange --help' for more information

vgchange -ay /dev/centos
  3 logical volume(s) in volume group "centos" now active
  
  --- Logical volume ---
  LV Path                /dev/centos/home
  LV Name                home
  VG Name                centos
  LV UUID                Ulv6ZU-bWj6-0cPh-l8nM-Xkw6-aoMI-SRVgtz
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-19 03:54:34 -0400
  LV Status              available
  
挂载

mount  /dev/centos/home /disk8t

[root@localhost ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/centos-home
                      7.3T  3.8T  3.5T  53% /disk8t  
                      
写入开机自动挂载 再确认下文件系统


[root@localhost ~]# df -T
Filesystem           Type   1K-blocks       Used  Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                     ext4    51475068     753184   48100444   2% /
tmpfs                tmpfs   32935580          0   32935580   0% /dev/shm
/dev/sda2            ext4      487652      27508     434544   6% /boot
/dev/sda1            vfat      204580        276     204304   1% /boot/efi
/dev/mapper/VolGroup-lv_home
                     ext4   163886508      60864  155493972   1% /home
/dev/mapper/centos-home
                     xfs   7742543872 4031224336 3711319536  53% /disk8t
                     
vi /etc/fstab                     
/dev/centos/home        /disk8t                 xfs     defaults        0 0    

             

                 

标签: 硬盘分区

非特殊说明,本博所有文章均为博主原创。

最新文章

发表评论