Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

windows xp and ubunto on same hard drive

  Date: Dec 28    Category: Unix / Linux / Ubuntu    Views: 474
  


will i have a problem if windows gets a vires on the hard drive.will
it start eating up files and start having problems with ubunto, or
should i just run two hard drives instead of one that way i dont have
a problem

Share: 

 

7 Answers Found

 
Answer #1    Answered On: Dec 28    


There is no problem if each OS running on a separate partition.

 
Answer #2    Answered On: Dec 28    


When an OS is installed (either Windows or Linux), it is usually onto
at least its own partition if not separate disk. Installing them on a
separate disk makes a lot of sense if it can be afforded.

However, if a virus gets onto a Window hard drive (let's say only one
hard drive and partitioned separately for Linux), then if the MBR
(Master Boot Record) is also compromised by the virus, then you won't
be able to get into the Linux OS environment until that problem is
resolved.

A Grub boot loader can help as well as a separate hard drive for the
different OSes. If two hard drives cannot be afforded, then it is
always a good idea to separate your OS files from your data files in
different partitions, and if you have enough space to spare throw in a
backup partition to help recover from such problems.

Typically, but not always required, Linux can be partitioned into a
/boot, a / or root partition, and a swap partition. The / partition
has the most space, swap about 2-4 times RAM size, and the /boot the
least.

When I kicked out too early of a parallel reinstall of WinXP Pro SP2,
it damaged my MBR and I could not boot into my installed Linux on
another hard drive from a Grub boot selection menu. Luckily, I had
saved off my MBRs of both my Windows and Linux hard drives onto my
Linux drive in /root/MBRs subdirectory that I had created. Windows
was installed on /dev/sda and Linux on /dev/sdb, so it was a simple
matter to save the MBRs as follows:

To save the Windows MBR onto the Linux hard drive when logged into the
installed Linux hard drive or partition OS:
# dd if=/dev/sda of=/root/MBRs/sdambr bs=512 count=1

To save the Linux MBR onto the Linux hard drive when logged into the
installed Linux hard drive or partition OS:
# dd if=/dev/sdb of=/root/MBRs/sdbmbr bs=512 count=1

Using Ubuntu Live CD, I saved off new copies of both MBRs, compared
them with a diff command and xxd command, and found out that the
Windows MBR had been trashed meaning that since I had a copy of the
old one, I could replace it and restore the Grub boot menu function.

To restore the Windows MBR (using an Ubuntu Live CD as the root user,
i.e. sudo -i:
First, make a mount point directory and then mount the Linux hard
drive into the Live CD environment:
# mkdir /tmp/disks-conf-sdb2
# mount -v -t ext3 /dev/sdb /tmp/disks-conf-sdb2

To rewrite the Windows MBR onto the Windows hard drive:
# dd if=/tmp/disks-conf-sdb2/root/MBRs/sdambr of=/dev/sda bs=512 count=1

After rebooting, I was then able to successfully select my installed
Linux OS even though WinXP Pro SP2 was still unstable.

 
Answer #3    Answered On: Dec 28    


Partition ( well make a section for windows ) and install windows first then
install Ubuntu. Ubuntu will install GRUB and add the menu for WinXp and
Ubuntu, did this at work on our shop laptop and it works great.

 
Answer #4    Answered On: Dec 28    

I don't think that is what he's getting at... I assume he's already got
both installed and is worried if Windows gets a virus can it hurt his
Ubuntu installed, the answer is maybe.

If malicious software gets in and changes your MBR (master boot record)
then it can overwrite the partition table and while your data will still
be there your computer won't know where what partition and you'll be
unable to access it. I don't think many, if any, currently active
viruses actually do this, but it is possible.

Assuming you run Ubuntu most of the time, my advice is setup a cron
script to use dd to copy your mbr containing your boot sector and your
partition table to an off-disk location, a floppy (ew) or an SD card or
just upload it via FTP off-site, it'll only be 512 bytes so very easy to
upload.

Then in the event anything goes wrong you can boot from the live CD and
retrieve the file from wherever it is you put it and restore it using dd
again.

Doing this is part of my full backup solution and has come in handy not
for viruses but there was a Windows update that rewrote the MBR to
Windows liking and made Ubuntu disappear, I just did what I outlined
above and presto, it was back.

Oh, also, be aware that individual files should be safe as long as
Windows can't read them, so if you use ext2 or 3, hfs, reiserfs, etc...
Windows can't natively mount these file systems so a virus getting into
the system would have to install a specialized driver into Windows to
allow it to read them before it could specifically attack files on those
partitions.

 
Answer #5    Answered On: Dec 28    


If it were me and I was worried about malicious mischief on the web I would
simply (as you stated) run two hard drives making sure Ubuntu is the Master and
Windows is the slave. Make sure you fix the jumpers on the hd's so that occurs.
Go into the bios and make sure the machine boots to the cd-rom drive first and
Ubuntu second. Drop your Ubuntu install disk into the cd-rom drive. Shut the
machine off. Put it back on and the machine will boot to the install disk and at
the end of the installation the grub will see the Windows drive and your worries
of viruses spreading to the Ubuntu disk are over. If you're still worried you
can always grab ClamAV from the synaptic package manager and install that. Now
you have several different ways to do your thing.

 
Answer #6    Answered On: Dec 28    

If one is that worried about it, the best and only sure line of defense
rests in a full system backup, now after playing with it for some time
myself I worked out that really, you don't need and binaries unless you
have not installed them from packages (I make sure everything I install
from source or manually is in /usr/local and I back that up.

/etc
/home
/usr/local
/usr/shared/themes
/usr/shared/fonts
/usr/shared/icons
/var/www
/var/log

Then I use a few commands to export my list of installed packages in a
format that can be easily imported...

dpkg --get-selections > installed-packages.txt


The mysql databases are backed up separately along with images using dd
of the mbr of all the hard disks directly connected to the system (ie
via the controller not usb or firewire). Put all of that into a tar
ball with gzip compression (I preferred bzip2 but the time for the
backup to complete was insane).

I bought a 250Gig external drive that connects via USB, I also moved my
larger media files out there (songs, videos, etc...).

The 250Gig is all ext3 so Windows has NO idea what it is, an image of
its mbr is sent to gmail via email so I can retrieve it in case
something messes that up horribly.

The script I use also adds to the backup the entire WindowsXP drive.

It is an excellent solution and solves for more than just a virus on the
system. Hard disks fail, programs do strange things, hell sometimes a
kernel bug can hose a system beyond repair (although that only happened
to me once).

 
Answer #7    Answered On: Dec 28    

Or, seperate drives on pull-out trays, more of a pain to switch but complete
isolation..

 
Didn't find what you were looking for? Find more on windows xp and ubunto on same hard drive Or get search suggestion and latest updates.




Tagged: