Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
紧急求救!!!!对文件系统有研究的高手过
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese)
View previous topic :: View next topic  
Author Message
whblackhorse
n00b
n00b


Joined: 15 Mar 2004
Posts: 36
Location: cn

PostPosted: Tue Dec 14, 2004 2:19 pm    Post subject: 紧急求救!!!!对文件系统有研究的高手过 Reply with quote

昨天,同学要装gentoo,但他的机器比较慢,现在又没有时间编译
我就想了个办法把我的硬盘挂到他的机器上,然后启动到我的一个后备系统下
再把我的主系统cp -a全拷给他(我们的硬件配置差不多)

挂好硬盘,设好jumper,顺利进入系统,我的盘是/dev/hda他的是hdb,hdb5是要设成swap分区的,我就mkswap /dev/hdb5,但敲成了/dev/hda5,一字之差,我后悔啊(hda5是我的主系统分区啊)

我想数据应该还没丢吧,只是一秒钟的事,mkswap就做完了
有什么方法恢复吗?

btw 有没有谁知道mkswap的实现?我想看一下源码,thx

欲哭无泪啊


Last edited by whblackhorse on Wed Dec 22, 2004 1:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hauser
l33t
l33t


Joined: 27 Dec 2003
Posts: 650
Location: 4-dimensional hyperplane

PostPosted: Tue Dec 14, 2004 3:59 pm    Post subject: Reply with quote

應該是沒得救了。吸取教訓吧,一個是使用mkfs,fdisk,rm -rf之類的指令要格外小心;二是要做好系統備份(最好是備份到光碟上,我以前就試過一次硬碟突然間給燒壞了 :( ),怕就怕這一類的無法修復的事故啊。
_________________
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Wed Dec 15, 2004 12:06 pm    Post subject: Reply with quote

标题中的叹号个数与你的问题得以解决的可能性并非成正比关系, 以后发贴请尽量避免使用叹号, 谢谢.

发贴指引
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
ldh168
n00b
n00b


Joined: 14 Dec 2004
Posts: 19

PostPosted: Wed Dec 15, 2004 1:54 pm    Post subject: Reply with quote

呵呵,最重要的在于备份,我因分区经常改来改去造成分区表损坏不是一次两次了,更倒霉的是前两天我的hdb坏了(IBM腾龙三代),数据也全没了,所以备份非常重要。
Back to top
View user's profile Send private message
qing
Tux's lil' helper
Tux's lil' helper


Joined: 04 Nov 2002
Posts: 95

PostPosted: Thu Dec 16, 2004 3:47 am    Post subject: Reply with quote

改过来。。。你什么文件系统。。。然后。。。fsck.xxx

试试。。。

是二进制程序的比较麻烦。。。所以。。。我建议大家

把gentoo 跟数据文件分开放。。。。让它们放在不同的分区。。。就算

以后不

小心给rm 等。。。马上fsck.xxxx也是可以恢复的。。。。


-----------------------------------

这里面有个重要的问题是。。。。数据是数据。。。这个最重要。。。

那个gentoo不重要吧。。。就算over了。。也可以用packages.iso

来重新安装就是了。。。
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Thu Dec 16, 2004 3:50 am    Post subject: Reply with quote

我买了刻录机, 基本每月一次 stage4 整系统备份.
名言: 没有备份的数据是无意义的数据.

//comfort
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
qing
Tux's lil' helper
Tux's lil' helper


Joined: 04 Nov 2002
Posts: 95

PostPosted: Thu Dec 16, 2004 4:46 am    Post subject: Reply with quote

EricHsu wrote:
我买了刻录机, 基本每月一次 stage4 整系统备份.
名言: 没有备份的数据是无意义的数据.

//comfort


我指的数据是。。。像电影。。书籍 音乐。。等等。。。

不是gentoo本身。。。当然。。。对你需要的源代码也包含在内。。。
Back to top
View user's profile Send private message
Hauser
l33t
l33t


Joined: 27 Dec 2003
Posts: 650
Location: 4-dimensional hyperplane

PostPosted: Thu Dec 16, 2004 5:05 am    Post subject: Reply with quote

我覺得兩者都重要。資料是平時用電腦慢慢累積的東西,當然要小心保存啦,備份系統則是因為Gentoo的安裝設置比較費時,所以不能偷懶啊。
_________________
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Back to top
View user's profile Send private message
whblackhorse
n00b
n00b


Joined: 15 Mar 2004
Posts: 36
Location: cn

PostPosted: Thu Dec 16, 2004 8:45 am    Post subject: Reply with quote

qing wrote:
改过来。。。你什么文件系统。。。然后。。。fsck.xxx

试试。。。

是二进制程序的比较麻烦。。。所以。。。我建议大家

把gentoo 跟数据文件分开放。。。。让它们放在不同的分区。。。就算

以后不

小心给rm 等。。。马上fsck.xxxx也是可以恢复的。。。。


-----------------------------------

这里面有个重要的问题是。。。。数据是数据。。。这个最重要。。。

那个gentoo不重要吧。。。就算over了。。也可以用packages.iso

来重新安装就是了。。。
ext3的分区格式
我试过fsck了不行
Quote:
bash-2.05b# fsck.ext3 /dev/hda5
e2fsck 1.35 (28-Feb-2004)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Filesystem has unexpected block size while trying to open /dev/hda5

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

bash-2.05b# e2fsck -b 8193 /dev/hda5
e2fsck 1.35 (28-Feb-2004)
e2fsck: Bad magic number in super-block while trying to open /dev/hda5

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

本想备份的,但盘上空间不够,自己又没有刻录机
谁知。。。。。。。
Back to top
View user's profile Send private message
qing
Tux's lil' helper
Tux's lil' helper


Joined: 04 Nov 2002
Posts: 95

PostPosted: Thu Dec 16, 2004 8:59 am    Post subject: Reply with quote

Hauser wrote:
我覺得兩者都重要。資料是平時用電腦慢慢累積的東西,當然要小心保存啦,備份系統則是因為Gentoo的安裝設置比較費時,所以不能偷懶啊。


我是用GRP安装的。。里面有gnome kde. fluxbox .xfce 等。。这些

是不再需要下载编译的。。。。做备份的可以就是你需要的其它包。。。

可以用emerge 来打包。。。保存。。这些节省很多备份需要的空间啊。。。
Back to top
View user's profile Send private message
Hauser
l33t
l33t


Joined: 27 Dec 2003
Posts: 650
Location: 4-dimensional hyperplane

PostPosted: Thu Dec 16, 2004 10:46 am    Post subject: Reply with quote

你們的硬碟空間如此拮据?
我的系統接近4G,做了完全備份可以擺到2張光碟上。好處是系統給照了像一樣,出了什麼事還原之後無需做任何額外的設置。 :)
_________________
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Thu Dec 16, 2004 11:26 am    Post subject: Reply with quote

en, 个人经验, 2 G 多的系统 (功能已经很完备) 打个 stage4 的 .tar.bz2 包就刚好能刻到一张 700M 的光盘里.
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
Hauser
l33t
l33t


Joined: 27 Dec 2003
Posts: 650
Location: 4-dimensional hyperplane

PostPosted: Thu Dec 16, 2004 11:34 am    Post subject: Reply with quote

有時候難以控制啊,東西越裝越多。 :oops:

不過我另有一個較小的系統,現在系統的前身,算是我的stage4吧,可以擺到重制的700M的LiveCD上。 :)
_________________
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Thu Dec 16, 2004 1:05 pm    Post subject: Reply with quote

我装每一个软件都做笔记, 这样可以跟踪自己都往系统里塞了什么东西, 尤其是当前 portage 暂时不支持反向依赖 (reverse dependencies) 处理的情况下, 自己做记录跟踪包的依赖关系还是有好处的, unmerge 的时候可以把系统清得干净些 ;)

我现在学乖了, 这次重装就在基本系统 (装完内核, 添加完帐号, 设置好一些基本的服务) 完成之后就打了一个 stage4 的 minimal 包 (249 M). 它将成为我以后任何 "重新开始" 的基础 :)

Edit: typo.
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
Hauser
l33t
l33t


Joined: 27 Dec 2003
Posts: 650
Location: 4-dimensional hyperplane

PostPosted: Thu Dec 16, 2004 1:31 pm    Post subject: Reply with quote

EricHsu wrote:
自己做记录跟踪包的依赖关系还是有好处的, unmerge 的时候可以把系统清得干净些 ;)

這個可以用"emerge depclean",完了再"revdep-rebuild",當然前提是使用portage方法正確,比如不要直接"emerge xxxx.ebuild"等。
EricHsu wrote:
我现在学乖了, 这次重装就在基本系统 (装完内核, 添加完帐号, 设置好一些基本的服务) 完成之后就打了一个 stage4 的 minimal 包 (249 M). 它将成为我以后任何 "重新开始" 的基础 :)

我那個小系統的備份也是出於這樣的考慮,不過我的系統大一點,包括了XFCE4,Firefox和OpenOffice。 :)
_________________
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Back to top
View user's profile Send private message
qing
Tux's lil' helper
Tux's lil' helper


Joined: 04 Nov 2002
Posts: 95

PostPosted: Fri Dec 17, 2004 2:30 am    Post subject: Reply with quote

EricHsu wrote:
我装每一个软件都做笔记, 这样可以跟踪自己都往系统里塞了什么东西, 尤其是当前 portage 暂时不支持反向依赖 (reverse dependencies) 处理的情况下, 自己做记录跟踪包的依赖关系还是有好处的, unmerge 的时候可以把系统清得干净些 ;)

我现在学乖了, 这次重装就在基本系统 (装完内核, 添加完帐号, 设置好一些基本的服务) 完成之后就打了一个 stage4 的 minimal 包 (249 M). 它将成为我以后任何 "重新开始" 的基础 :)

Edit: typo.


如何做笔记呢??

没有很好的脚本管这事吗??
Back to top
View user's profile Send private message
lit40
n00b
n00b


Joined: 29 Nov 2004
Posts: 8
Location: china

PostPosted: Fri Dec 17, 2004 12:37 pm    Post subject: Reply with quote

Quote:
如何做笔记呢??

没有很好的脚本管这事吗??
你可以用下来吧,呵呵 :)
Back to top
View user's profile Send private message
qing
Tux's lil' helper
Tux's lil' helper


Joined: 04 Nov 2002
Posts: 95

PostPosted: Fri Dec 17, 2004 12:44 pm    Post subject: Reply with quote

lit40 wrote:
Quote:
如何做笔记呢??

没有很好的脚本管这事吗??
你可以用下来吧,呵呵 :)


难道不能这样。。。输入文件吗??

emerge xxx >> install.txt
Back to top
View user's profile Send private message
Hauser
l33t
l33t


Joined: 27 Dec 2003
Posts: 650
Location: 4-dimensional hyperplane

PostPosted: Fri Dec 17, 2004 7:51 pm    Post subject: Reply with quote

qing wrote:
lit40 wrote:
Quote:
如何做笔记呢??

没有很好的脚本管这事吗??
你可以用下来吧,呵呵 :)


难道不能这样。。。输入文件吗??

emerge xxx >> install.txt

Try this: # emerge -pv packagename | tee >> install.txt :D
_________________
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Sat Dec 18, 2004 3:45 pm    Post subject: Reply with quote

Hauser wrote:

這個可以用"emerge depclean",完了再"revdep-rebuild",當然前提是使用portage方法正確,比如不要直接"emerge xxxx.ebuild"等。


emerge depclean 不够聪明, 像我现在 emerge -p depclean, 它竟然列出了 grub, hoho... 还是自己跟踪好一些, 而 emerge -p depclean 的结果仅供自己参考, 不过, 最根本的办法还是养成良好的习惯, 别乱装东西, 且熟练掌握 portage 的各个工具 :)

Quote:

我那個小系統的備份也是出於這樣的考慮,不過我的系統大一點,包括了XFCE4,Firefox和OpenOffice。 :)


我正在打磨现在的系统, 过些天满意了就再打一个 stage4 的包, 现在只装了 XFCE 4.2 RC2 (出来了哦), 和 gnome-light.
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Sat Dec 18, 2004 3:48 pm    Post subject: Reply with quote

lit40 wrote:
Quote:
如何做笔记呢??

没有很好的脚本管这事吗??
你可以用下来吧,呵呵 :)


YES! 我的 gentoo 手写笔记做了一大堆, 经过这么多年的计算机生涯, 终于认清一点: 这世界上最可靠的资料记录方式就是钢笔 (炭素墨水) 加白纸, :lol:
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Sat Dec 18, 2004 3:50 pm    Post subject: Reply with quote

Hauser wrote:

Try this: # emerge -pv packagename | tee >> install.txt :D


我两种方式都用:
1. 有一个专门的目录 emerge-log/ 里面放了每一次: emerge -pv [pkg] 的信息
2. 还有钢笔手稿记录

负责的男人都要做好 "安全措施" :lol:
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
whblackhorse
n00b
n00b


Joined: 15 Mar 2004
Posts: 36
Location: cn

PostPosted: Wed Dec 22, 2004 1:05 pm    Post subject: Reply with quote

研究了一个多星期,查了许多资料
终于搞定了
有时间写个总结
:lol: :lol: :lol: :lol:
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Wed Dec 22, 2004 2:01 pm    Post subject: Reply with quote

whblackhorse wrote:
研究了一个多星期,查了许多资料
终于搞定了
有时间写个总结
:lol: :lol: :lol: :lol:


Really?! 数据都救回来了?? 先恭喜!!

赶紧的, 把要点大纲先 post 出来! 然后慢慢添加内容! :D
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
meteozwh
n00b
n00b


Joined: 27 May 2003
Posts: 46

PostPosted: Fri Dec 24, 2004 4:54 pm    Post subject: Reply with quote

我这里emerge -p depclean工作得很好,实际上,我的体会是如果以前没用过emerge depclean,第一次用的时候一定要小心,利用第一次用的机会把该保留的软件包放到/var/lib/portage/world中,之后就可以高枕无忧了。我已经用了大半年emerge depclean了,没有任何问题

BTW,虽然有拍马匹之嫌,但我还是忍不住说,版主真是敬业啊,惭愧。我这一段时间特别忙,一直没上来过,一上来就看到n篇版主自己写的总结。以后一定会抽空常来的。
EricHsu wrote:
Hauser wrote:

這個可以用"emerge depclean",完了再"revdep-rebuild",當然前提是使用portage方法正確,比如不要直接"emerge xxxx.ebuild"等。


emerge depclean 不够聪明, 像我现在 emerge -p depclean, 它竟然列出了 grub, hoho... 还是自己跟踪好一些, 而 emerge -p depclean 的结果仅供自己参考, 不过, 最根本的办法还是养成良好的习惯, 别乱装东西, 且熟练掌握 portage 的各个工具 :)

Quote:

我那個小系統的備份也是出於這樣的考慮,不過我的系統大一點,包括了XFCE4,Firefox和OpenOffice。 :)


我正在打磨现在的系统, 过些天满意了就再打一个 stage4 的包, 现在只装了 XFCE 4.2 RC2 (出来了哦), 和 gnome-light.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese) All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum