极狐GitLab 正式推出面向 GitLab 老旧版本(12.x、13.x、14.x、15.x 等)免费用户的专业升级服务,点击查看详情

返回列表 发布新帖

由于系统盘出问题无法,gitlab部分配置运行报错,应该如何恢复

448 1
发表于 2025-9-13 18:30:43 | 显示全部楼层 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×

由于系统盘出问题无法,gitlab部分配置运行报错,包括备份命令(sudo gitlab-backup create),config命令 (sudo gitlab-ctl) reconfigure等都报IO错误,如果想重新安装对应版本的gitlab,之前的git 仓库还能识别到吗,需要怎么恢复,求大神支招

回复

使用道具 举报

评论1

wangkaixuanLv.7 发表于 2025-11-17 11:16:16 | 显示全部楼层
如果是系统盘出问题,那么只能通过恢复裸仓库的方式来恢复了。

比如:
创建恢复的目录
mkdir /tmp/repo_restore
cd /tmp/repo_restore
查看某个仓库的 hashed 路径
ls -l  /var/opt/gitlab/git-data/repositories/@hashed/e2/9c/e29c9c180c6279b0b02abd6a1801c7c04082cf486ec027aa13515e4f3884bb6b.git/
临时拷贝到带恢复的目录下
cp -r /var/opt/gitlab/git-data/repositories/@hashed/e2/9c/e29c9c180c6279b0b02abd6a1801c7c04082cf486ec027aa13515e4f3884bb6b.git   /tmp/repo_restore

git clone /tmp/repo_restore/e29c9c180c6279b0b02abd6a1801c7c04082cf486ec027aa13515e4f3884bb6b.git restored-project

cd restored-project
git remote remove origin
git remote add origin git@NEW_GITLAB:newgroup/newproject.git
git push --mirror origin


大致的思路是这样的
回复

使用道具 举报

意见建议

Email:forum@gitlab.cn
  • 关注公众号
  • 添加专业顾问
Copyright © 2001-2025 极狐GitLab论坛 版权所有 All Rights Reserved. 鄂ICP备2021008419号-1|鄂公网安备42018502006137号
关灯 快速发帖
扫一扫添加专业顾问
返回顶部
快速回复 返回顶部 返回列表