LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-06-2005, 04:10 PM   #1
dhlw
LQ Newbie
 
Registered: May 2005
Location: Brazil
Posts: 23

Rep: Reputation: 15
Breezy Install CD destroyed FAT32 partition


After too many unsuccessful attempts to count to get Breezy Badger to dual-boot Windows XP on this HP notebook, I was amazed how a clean Install CD exclusively to /dev/sda - including putting GRUB on that external drive Linux partition - on an external FireWire 160GB Seagate disk also clobbered the OSshare FAT32 partition I'd carefully partitioned on internal IDE drive. 30GB IDE disk had been partitioned in Windows XP/Partition Magic so:

Code:
/dev/hda1   pri      FAT16     small hidden HP Factory install for recovery
/dev/hda2   pri      ntfs   *  WinXP boot partition, about 20GB
/dev/hda5   Logical  FAT32     rest of disk about 9GB for OS sharing
Used a place-holder 30GB ntfs partition from Windows right at start of external drive to be able to let Ubuntu 5.10 LiveCD delete and then 'guided partitioning' all first partition's free space to get:

Code:
/dev/sda1   pri      ext3   /  Linux partitioned boot, about 29GB
/dev/sda4   pri      swap      Linux configured swap, about 1G
/dev/sda2   pri      FAT32     already existing earlier from Windows
/dev/sda5   Logical  ntfs      ditto
/dev/sda6   Logical  ntfs      ditto
/dev/sda7   Logical  ntfs      ditto
Tried to copy first 512 bytes of /dev/sda with command as root during install

Code:
dd if=/dev/sda1 of=bbboot.bin bs=512 count=1
hoping to be able to later copy this bbboot.bin file to /dev/hda5 FAT32 and then in WindowsXP write it to C: root directory after altering Windows boot.ini script to be able to use ntldr to dual-boot - adding
Code:
C:\bbboot.bin="Start Ubuntu BREEZY BADGER"
Result of my dd command only successful if output file is Linux / as above. If attempt to output examples of=/dev/sda2/bbboot.bin (a vfat that doesn't seem to be mounted) or of=/dev/hda5/bbboot.bin or anywhere like to a of= floppy, I'm told 'bbboot.bin is not a directory'

OK, also tried to mount/dev/hda5 at some point too.

Feeling lost I reboot Windows and discover /dev/hda5 Windows FAT32 partition is no longer formatted and all files on it had disappeared. I had back-ups mirrored on an external disk partition so I reformatted /dev/hda5 again as FAT32 in WindowsXP Disk Mgt.

Obviously am doing a bunch of things wrong. Can anyone help, you know baby steps, spelling it out line by line? Thanks.
 
Old 12-06-2005, 06:08 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by dhlw
Obviously am doing a bunch of things wrong.
Obviously.
Maybe you should change the thread title. It ain't the "Breezy Install CD" that destroyed that partition - one more guess as to who might be the responsible party.

dd is the gun, you shot yourself in the foot. Full points for the backup - you're one of the few that plan ahead that well.
The mistake you made was to have the outfile point to a physical resource - in your case a partition.
This overwrites from the start of the partition - rather than using any filesystem that might be defined on said partition.
What you need to do is use a mountpoint reference for the of; something like
"of=/mnt/floppy/bbboot.bin" or "/mnt/shared/bbboot.bin" - whatever is appropriate (and mounted). df command will tell you what you have to work with.
 
Old 12-07-2005, 07:49 AM   #3
dhlw
LQ Newbie
 
Registered: May 2005
Location: Brazil
Posts: 23

Original Poster
Rep: Reputation: 15
Many thanks, syg00, for schooling. Very helpful.
Tell me how to change thread title and I'll happily do so to "DD can destroy a FAT32 partition" but LQ Edit only lets posters edit the body of posts, not thread title.
 
Old 12-07-2005, 08:03 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
You're welcome - hope you get it to work. HP can apparently be a pain, but you should be able to get grub to boot everything. Regardless, the strategy you're pursueing should work fine.

As for dd, it can destroy any partition. Not to mention whole disks - handy tool, but brutal ...
 
Old 12-07-2005, 08:29 AM   #5
dhlw
LQ Newbie
 
Registered: May 2005
Location: Brazil
Posts: 23

Original Poster
Rep: Reputation: 15
syg00,

If I can rob your next two seconds, please confirm this command sequence will do the trick next time try Ubuntu 5.10 Install CD (during install, in root shell)

Code:
mkdir /mnt/hda5        #create mountpoint for IDE Windows C: FAT32 partition
mount -t vfat /dev/hda5 /mnt/hda5
dd if=/dev/sda1 of=/mnt/hda5/bbboot.bin bs=512 count=1
cp /mnt/hda5/bbboot.bin /dev/hda5  #hopefully keeps IDE FAT32 partition intact
umount /mnt/hda5
then find bbboot.bin Windows XP FAT32 partition, copy to C: and alter boot.ini

TIA.
 
Old 12-07-2005, 03:44 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Remove the copy - dd will create the file correctly on the vfat partition.
As you described, the copy (to C: ) is done once you reboot XP.
You probably shouldn't need the type switch in the mount command either, but won't do any harm by using it.
 
Old 12-07-2005, 03:49 PM   #7
dhlw
LQ Newbie
 
Registered: May 2005
Location: Brazil
Posts: 23

Original Poster
Rep: Reputation: 15
Ta very much, syg00.
I'll take a crack at this tomorrow, time permitting.

[EDITED 12-09-2005]
For what it's worth, as installed Madriva Linux 2006 on external 160GB FireWire this is probably not the forum to continue this thread, I've still got ways to go to dual-boot with Windows XP.
Thanks to syg00 for teaching me Mountpoints, DD worked fine. GRUB threw an Error 17 when selecting 'Start Mandriva Linux' in NTLDR boot option. So loaded Ubuntu Breezy LiveCD to mount external drive / then startx.
Xorg stopped that. Wonder if it's because LiveCD won't release screen?

I've copied a bunch of things I did if anybody wants to chip in here. First time tried launch Mandriva 2006 on external /dev/sda5 during Ubuntu 5.10 LiveCD session. Any line separators are for readability.
Code:

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           1           0    0  Empty
Partition 1 does not end on cylinder boundary.
/dev/sda2            3825        7776    31744440    c  W95 FAT32 (LBA)
/dev/sda3               1       19457   156288321    f  W95 Ext'd (LBA)
/dev/sda5               1         764     6136767   83  Linux
/dev/sda6            7777       11728    31744408+   7  HPFS/NTFS
/dev/sda7           11729       15552    30716248+   7  HPFS/NTFS
/dev/sda8           15553       19457    31366881    7  HPFS/NTFS
/dev/sda9             765         904     1124518+  82  Linux swap / Solaris
/dev/sda10            905        3824    23454868+  83  Linux

Partition table entries are not in disk order

Disk /dev/hda: 30.0 GB, 30005821440 bytes
255 heads, 63 sectors/track, 3648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               2           9       64260   84  OS/2 hidden C: drive
/dev/hda2   *          10        2553    20434680    7  HPFS/NTFS
/dev/hda3            2554        3648     8795587+   f  W95 Ext'd (LBA)
/dev/hda5            2554        3648     8795556    b  W95 FAT32

==================================================
ubuntu@ubuntu:~$ sudo mkdir /mnt/BreezyBadger
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/sda5 /mnt/BreezyBadger
ubuntu@ubuntu:~$ sudo chroot /mnt/BreezyBadger
bash-3.00# startx
hostname: Host name lookup failure  
xauth:  error in locking authority file /home/ubuntu/.serverauth.27699
xauth:  error in locking authority file /home/ubuntu/.Xauthority
xauth:  error in locking authority file /home/ubuntu/.Xauthority
xauth:  error in locking authority file /home/ubuntu/.Xauthority
xauth:  error in locking authority file /home/ubuntu/.Xauthority


This is a pre-release version of the The X.Org Foundation X11.
It is not supported in any way.
Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
Select the "xorg" product for bugs you find in this release.
Before reporting bugs in pre-release versions please check the
latest version in the The X.Org Foundation "monolithic tree" CVS
repository hosted at http://www.freedesktop.org/Software/xorg/
X Window System Version 6.8.99.900 (6.9.0 RC 0)
Release Date: 01 August 2005 + cvs
X Protocol Version 11, Revision 0, Release 6.8.99.900
Build Operating System: Linux 2.6.12-12mdksmp i686 [ELF]
Current Operating System: Linux ubuntu 2.6.12-9-386 #1 Mon Oct 10 13:14:36 BST 2005 i686
Build Date: 16 September 2005
        Before reporting problems, check http://wiki.X.Org
        to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Dec  9 11:40:32 2005
(==) Using config file: "/etc/X11/xorg.conf"
Using vt 8
(EE) No devices detected.

Fatal server error:
no screens found

Please consult the The X.Org Foundation support
         at http://wiki.X.Org
 for help.
Please also check the log file at "/var/log/Xorg.0.log" for additional information.

XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
      after 0 requests (0 known processed) with 0 events remaining.
xauth:  error in locking authority file /home/ubuntu/.Xauthority

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

bash-3.00# cat /etc/fstab
/dev/sda5 / ext3 noatime 1 1
/dev/sda10 /home ext3 noatime 1 2
/dev/hdc /mnt/cdrom auto umask=0,user,iocharset=iso8859-1,codepage=850,noauto,ro,exec,users 0 0
/dev/sr0 /mnt/cdrom2 auto umask=0,user,iocharset=iso8859-1,codepage=850,noauto,ro,exec,users 0 0
/dev/hda2 /mnt/win_c ntfs umask=0,nls=iso8859-1,ro 0 0
/dev/hda5 /mnt/win_d vfat umask=0,iocharset=iso8859-1,codepage=850 0 0
/dev/sda6 /mnt/win_d2 ntfs umask=0,nls=iso8859-1,ro 0 0
/dev/sda7 /mnt/win_e ntfs umask=0,nls=iso8859-1,ro 0 0
/dev/sda8 /mnt/win_f ntfs umask=0,nls=iso8859-1,ro 0 0
/dev/sda2 /mnt/win_g vfat umask=0,iocharset=iso8859-1,codepage=850 0 0
none /proc proc defaults 0 0
/dev/sda9 swap swap defaults 0 0

bash-3.00# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda5              6040256   1832080   3901340  32% /

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

bash-3.00# cat /boot/grub/menu.lst
timeout 15
color black/cyan yellow/cyan
default 0

title linux
kernel (hd0,4)/boot/vmlinuz root=/dev/sda5  resume=/dev/sda9 splash=silent vga=788
initrd (hd0,4)/boot/initrd.img

title linux-nonfb
kernel (hd0,4)/boot/vmlinuz root=/dev/sda5  resume=/dev/sda9
initrd (hd0,4)/boot/initrd.img

title failsafe
kernel (hd0,4)/boot/vmlinuz root=/dev/sda5  failsafe resume=/dev/sda9
initrd (hd0,4)/boot/initrd.img

title windows
root (hd1,1)
map (0x81) (0x80)
map (0x80) (0x81)
makeactive
chainloader +1

title windows1
root (hd0,1)
chainloader +1

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


bash-3.00# ls /boot/grub
device.map     ffs_stage1_5      jfs_stage1_5            menu.lst.example   stage1         vstafs_stage1_5
e2fs_stage1_5  install.sh        mdv-grub_splash.xpm.gz  minix_stage1_5     stage2         xfs_stage1_5
fat_stage1_5   iso9660_stage1_5  menu.lst                reiserfs_stage1_5  ufs2_stage1_5
bash-3.00# grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97-13mdk  (640K lower / 3072K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]

grub> find /boot/grub/stage1
 (hd1,4)

grub> root (hd1,4)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd1,4)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd1,4)"... failed (this is not fatal)
 Running "embed /boot/grub/e2fs_stage1_5 (hd1,4)"... failed (this is not fatal)
 Running "install /boot/grub/stage1 (hd1,4) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.

grub> quit
Further, cfdisk said I had a problem in external partition #2 then quit.

May be interesting to do another Ubuntu Breezy Install CD install in lieu of the Mandriva 2006 but frankly am getting impression Linux partitioners are encountering problems Windows XP Disk Management doesn't face with this external FireWire Seagate ST316002 disk. Probably a Linux FireWire or USB 2.0 driver issue as IEEE1394a disk access seems to share a lot of USB2.0, SCSI common protocol or code.

Last edited by dhlw; 12-09-2005 at 12:56 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FC3 partition destroyed. XP can't install. securehack Linux - Software 14 06-05-2005 12:31 AM
Problem with Slack Install from FAT32 partition isibix Slackware 5 09-20-2004 05:08 PM
Partition Magic Destroyed Slackware! flamesrock Linux - Software 2 03-08-2004 09:07 PM
how to install redhat 9.0 on fat32 partition peevee Linux - Software 7 09-13-2003 06:36 PM
Install 9.0 from FAT32 partition? jdomingos Slackware 1 08-30-2003 04:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration