[RAS] Nebka disk
Thomas Krichel
krichel at openlib.org
Thu Mar 13 04:51:45 EDT 2008
Christian Zimmermann writes
> reboot
> # into 2.4 or 2.6?
into 2.6, SECOND entry,
> #at reboot in grub: single user mode (select kernel, press "e", select kernel line, press "e", append "single" at the end of the line, "enter", press "b", root password)
>
use the second entry, no editing required, I think.
> mount -o ro,remount /dev/sda1
Mount root disk read-only. Important.
>
> e2fsck -c -y /dev/sda1
>
> #according to the man page:
> # Note that in general it is not safe to run e2fsck on mounted filesys-
> # tems. The only exception is if the -n option is specified, and -c, -l,
> # or -L options are not specified. However, even if it is safe to do
> # so, the results printed by e2fsck are not valid if the filesystem is
> # mounted. If e2fsck asks whether or not you should check a filesystem
> # which is mounted, the only correct answer is "no". Only experts who
> # really know what they are doing should consider answering this question
> # in any other way.
> #I am no expert, in fact, I hardly understand what I am supposed to do here,
> #are you sure you want to do this?
>
A read only mounted disk can be savely checked. Otherwise
how would you check the file system
> # this takes a few hours.
> # what if something is wrong?
The -y option will automatically take corrective action
required
>
> reboot
>
> #single user again
>
> rsync -va --exclude /vol --exclude /proc --exclude /sys / /vol
>
> grub-install --directory /vol/boot/grub /dev/sdb1
>
> # do you mean
> #grub-install --root-directory=/vol/boot/grub /dev/sdb1
Yes, sorry!
> # this is how I would understand it from the man page on nebka.
> # and why not use update-grub?
That does a different thing, it updates the list of
kernels that are available.
> #sdb1, not sdb, right?
I think, but if it gripes try /dev/sdb instead.
>
> #edit /vol/etc/fstab putting the right device for the swap, but how?
I am not sure. Actually, there is a step missing, you need
to format the disk. I will do this right now.
Inspect and change partition table:
nebka:~# cfdisk /dev/sdb
nebka:~#
nebka:~#
nebka:~#
nebka:~# mke2fs -j /dev/sdb1
mke2fs 1.40-WIP (14-Nov-2006)
/dev/sdb1 is mounted; will not make a filesystem here!
nebka:~# mount /dev/sdb1
mount: /dev/sdb1 already mounted or /vol busy
mount: according to mtab, /dev/sdb1 is already mounted on /vol
nebka:~# cd /vol
nebka:/vol# ls
lost+found opt
nebka:/vol# cd
I should have done this to start with:
nebka:~# umount /vol
but it works like this too...
nebka:~# mke2fs -j /dev/sdb1
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
17924096 inodes, 35838999 blocks
1791949 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1094 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
nebka:~# mkswap /dev/sdb2
/dev/sdb2: No such device or address
It does not like to do the swap, but the /dev/sdb2 is
now earmarked for swap.
It should be ok for you to let the partition table
be as is, just comment out the part that mounts /dev/sdb
Actually I did it for you.
nebka:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/sda5 none swap sw 0 0
/dev/sda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda /media/cdrom iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy auto rw,user,noauto 0 0
/dev/hda /cdrom iso9660 ro,user,noauto 0 0
#/dev/sdb1 /vol ext3 defaults 0 1
> And I suppose that file will be rsynched from /etc/fstab, right?
Correct. If you switch the two disks, as you must do before the
final boot, it will say that what now is /dev/sdb
is what gets called /dev/sda, and the current configuration,
which places the swap at the end should be just fine.
I will go to town now, later to the opera. I expert to
be back by 23:00 local time, your 13:00. If you start
doing it then you can call me any time during the night,
leave me a number and I'll call you right back to discuss
the situation with you.
Good luck!
Cheers,
Thomas Krichel http://openlib.org/home/krichel
RePEc:per:1965-06-05:thomas_krichel
phone: +7 383 330 6813 skype: thomaskrichel
More information about the RAS-run
mailing list