Wednesday, April 24, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 10383  / 3 Years ago, fri, july 30, 2021, 12:39:22

I have removed mbr by mistake.



Now I can't boot ubuntu, so I want to reinstall grub.



I'm following this instructions.



The problem is that I'm getting this error:



grub-install --boot-directory=/media/cab64688-2d97-4bbd-9f32-7bc0badb40a8/boot /dev/sdb
rm: cannot remove `/media/cab64688-2d97-4bbd-9f32-7bc0badb40a8/boot/grub/915resolution.mod': Read-only file system


So, problem is that my existing ubuntu partition is mounted read only. When I try:



sudo mount /dev/sdb7  /media/ubuntu_mpt
mount: block device /dev/sdb7 is write-protected, mounting read-only


So I failed to install grub since I'm in read only mode.



Any idea?



Thanks in advance.



EDIT: After apt-get install grub, I repeated the process and got:



Probing devices to guess BIOS drives. This may take a long time.
Unknown partition table signature
sed: can't read /media/cab64688-2d97-4bbd-9f32-7bc0badb40a8_/boot/grub/device.map: No such file or directory
grep: /media/cab64688-2d97-4bbd-9f32-7bc0badb40a8_/boot/grub/device.map: No such file or directory
/dev/sda does not have any corresponding BIOS drive.


EDIT: Requested outputs:



fdisk -l

Disk /dev/sda: 163.9 GB, 163927522816 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sda doesn't contain a valid partition table

Disk /dev/sdb: 640.1 GB, 640133946880 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3dcf5202

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3917 31463271 7 HPFS/NTFS
/dev/sdb2 3918 77826 593667163 f W95 Ext'd (LBA)
/dev/sdb5 3918 43080 314576766 7 HPFS/NTFS
/dev/sdb6 77328 77826 4000768 82 Linux swap / Solaris
/dev/sdb7 43081 77197 274041856 83 Linux
/dev/sdb8 77197 77327 1045504 82 Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdc: 4043 MB, 4043284480 bytes
125 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b

This doesn't look like a partition table
Probably you selected the wrong device.

Device Boot Start End Blocks Id System
/dev/sdc1 ? 100405 247697 570754815+ 72 Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(357, 116, 40) logical=(100404, 79, 11)
Partition 1 has different physical/logical endings:
phys=(357, 32, 45) logical=(247696, 24, 51)
Partition 1 does not end on cylinder boundary.
/dev/sdc2 ? 21767 271577 968014120 65 Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(288, 115, 43) logical=(21766, 48, 47)
Partition 2 has different physical/logical endings:
phys=(367, 114, 50) logical=(271576, 60, 42)
Partition 2 does not end on cylinder boundary.
/dev/sdc3 ? 241276 491086 968014096 79 Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(366, 32, 33) logical=(241275, 3, 30)
Partition 3 has different physical/logical endings:
phys=(357, 32, 43) logical=(491085, 14, 39)
Partition 3 does not end on cylinder boundary.
/dev/sdc4 ? 372346 372354 27749+ d Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(372, 97, 50) logical=(372345, 119, 25)
Partition 4 has different physical/logical endings:
phys=(0, 10, 0) logical=(372353, 14, 33)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

mount
aufs on / type aufs (rw)
none on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
/dev/sr0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda on /media/Backup type ext4 (rw,nosuid,nodev,uhelper=udisks)
/dev/sdb7 on /media/cab64688-2d97-4bbd-9f32-7bc0badb40a8_ type ext4 (ro,nosuid,nodev,uhelper=udisks)

ls -lA /dev/disk/by-label
total 0
lrwxrwxrwx 1 root root 9 2011-06-12 18:32 Backup -> ../../sda
lrwxrwxrwx 1 root root 9 2011-06-12 18:31 Ubuntux2011.04x20i386 -> ../../sr0

More From » grub2

 Answers
2

I fixed the problem with the help of UNetbootin. Installed it and managed to boot into my ubuntu system (cnosole mode or poor graphic mode). Whatever you boot from this two, just run grub-install /dev/sdb where /dev/sdb is boot hdd set in bios. Restart and grub should work.


[#44660] Friday, July 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alkeake

Total Points: 467
Total Questions: 94
Total Answers: 126

Location: Tajikistan
Member since Tue, Jun 15, 2021
3 Years ago
;