if you reinstall Grub to the root of the Linux partition and not the MBR.
Need some help on it
My output code
Code:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@ubuntu:~$ sudo fdisk -i
fdisk: invalid option -- 'i'
Usage:
fdisk [options] <disk> change partition table
fdisk [options] -l <disk> list partition table(s)
fdisk -s <partition> give partition size(s) in blocks
Options:
-b <size> sector size (512, 1024, 2048 or 4096)
-c switch off DOS-compatible mode
-h print help
-u <size> give sizes in sectors instead of cylinders
-v print version
-C <number> specify the number of cylinders
-H <number> specify the number of heads
-S <number> specify the number of sectors per track
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 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: 0x7f0b6359
Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 * 6 1918 15360000 7 HPFS/NTFS
/dev/sda3 1918 41349 316734375 7 HPFS/NTFS
/dev/sda4 41349 60802 156250113 5 Extended
/dev/sda5 41349 60304 152251392 83 Linux
/dev/sda6 60304 60802 3997696 82 Linux swap / Solaris
Disk /dev/sdb: 16.0 GB, 16026435072 bytes
255 heads, 63 sectors/track, 1948 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: 0x000dcca8
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1949 15648768 c W95 FAT32 (LBA)
ubuntu@ubuntu:~$ sudo mount /dev/sd1/mnt
mount: can't find /dev/sd1/mnt in /etc/fstab or /etc/mtab
ubuntu@ubuntu:~$ sudo mount /dev/sda1/mnt
mount: can't find /dev/sda1/mnt in /etc/fstab or /etc/mtab
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt
ubuntu@ubuntu:~$ sudo mount--blind /proc/mnt/proc
sudo: mount--blind: command not found
ubuntu@ubuntu:~$ sudo mount --blind /proc/mnt/proc
mount: unrecognized option '--blind'
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .
ubuntu@ubuntu:~$ sudo mount --blind/proc/mnt/proc
mount: unrecognized option '--blind/proc/mnt/proc'
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
mount: mount point /mnt/dev does not exist
ubuntu@ubuntu:~$ sudo mount /dev/sda5 /mnt
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mount --bind /proc /mnt/proc
ubuntu@ubuntu:~$ sudo mount --bind /sys /mnt/sys
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# apt-get install grub-pc
Reading package lists... Done
Building dependency tree
Reading state information... Done
grub-pc is already the newest version.
grub-pc set to manually installed.
The following packages were automatically installed and are no longer required:
linux-headers-2.6.32-21
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 249 not upgraded.
root@ubuntu:/# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-24-generic-pae
Found initrd image: /boot/initrd.img-2.6.32-24-generic-pae
Found memtest86+ image: /boot/memtest86+.bin
ls: cannot access /casper-rw-backing: No such file or directory
ls: cannot access /casper-rw-backing: No such file or directory
ls: cannot access /casper-rw-backing: No such file or directory
ls: cannot access /casper-rw-backing: No such file or directory
ls: cannot access /casper-rw-backing: No such file or directory
ls: cannot access /casper-rw-backing: No such file or directory
ls: cannot access /media/5C86-15B3: No such file or directory
ls: cannot access /media/5C86-15B3: No such file or directory
ls: cannot access /media/5C86-15B3: No such file or directory
ls: cannot access /media/5C86-15B3: No such file or directory
ls: cannot access /media/5C86-15B3: No such file or directory
ls: cannot access /media/5C86-15B3: No such file or directory
Found Windows 7 (loader) on /dev/sda2
done
root@ubuntu:/# sudo mount /dev/sda6 /mnt/
/dev/sda6 looks like swapspace - not mounted
mount: you must specify the filesystem type
root@ubuntu:/# ls /mnt/home/*/Desktop/sda_before.img
ls: cannot access /mnt/home/*/Desktop/sda_before.img: No such file or directory
root@ubuntu:/# ls /mnt/home/ubuntu/Desktop/sda_before.img
ls: cannot access /mnt/home/ubuntu/Desktop/sda_before.img: No such file or directory
root@ubuntu:/# grub-install /dev/sda
Installation finished. No error reported.
root@ubuntu:/# grub-install --recheck
install_device not specified.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-setup=FILE use FILE as grub-setup
--grub-mkimage=FILE use FILE as grub-mkimage
--grub-probe=FILE use FILE as grub-probe
--no-floppy do not probe any floppy drive
--recheck probe a device map even if it already exists
--force install even if problems are detected
--disk-module=MODULE disk module to use
INSTALL_DEVICE can be a GRUB device name or a system device filename.
grub-install copies GRUB images into /boot/grub (or /grub on NetBSD and
OpenBSD), and uses grub-setup to install grub into the boot sector.
If the --root-directory option is used, then grub-install will copy
images into the operating system installation rooted at that directory.
Report bugs to <bug-grub@gnu.org>.
root@ubuntu:/# ls /mnt/home/ubuntu/*/sda_before.img
ls: cannot access /mnt/home/ubuntu/*/sda_before.img: No such file or directory
root@ubuntu:/# ls /mnt/home/ubuntu/*/Desktop/sda_before.img
ls: cannot access /mnt/home/ubuntu/*/Desktop/sda_before.img: No such file or directory
root@ubuntu:/# sudo mount /dev/sda5 /mnt/
root@ubuntu:/# ls /mnt/home/ubuntu/*/Desktop/sda_before.img
ls: cannot access /mnt/home/ubuntu/*/Desktop/sda_before.img: No such file or directory
root@ubuntu:/# ls /mnt/home/*/Desktop/sda_before.img
/mnt/home/diva/Desktop/sda_before.img
root@ubuntu:/# sudo dd if=/dev/sda of=/mnt/home/diva/Desktop/sda_after.img count=63
63+0 records in
63+0 records out
32256 bytes (32 kB) copied, 0.00096861 s, 33.3 MB/s
root@ubuntu:/#
Bookmarks