Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Using the guide on ubuntu.com I installed the image of the netbook edition on my external HDD using Pendrive on Windows. I was not aware that it would create such a mess and now want to get rid of it again, still retaining my old files. How can I do that?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If I'm not mistaken, the USB installer adds some files in the root folder of the USB disk and makes it bootable by adding some code in the Master Boot Record.

You can safely remove the files created by the USB installer using the Delete button.

You can restore (read: clear) the MBR (Master Boot Record) using the following command:

sudo dd if=/dev/zero of=/dev/sdX count=1 bs=512

/dev/sdX is your USB drive, if you run ls -l /dev/disk/by-label, you will labeled partitions, e.g.:

lrwxrwxrwx 1 root root 10 2011-03-04 22:58 ubuntu -> ../../sda1
lrwxrwxrwx 1 root root 10 2011-03-04 22:58 USBDRIVE -> ../../sdb1

Here, you can see that /dev/sdb is the external USB. If your partitions are not labeled, you could use sudo fdisk -l to get a list of partitions for each drive.

For relabeling the partition, you can use GParted, see How can I relabel my flash drive?.

share|improve this answer
    
Okay, knowing that already helps because I did not want to lose any data. Is there anything more that I might have to perform? For example, the HDD was also renamed to "PENDRIVE", how do I revert that? Thanks a lot for your answer :)! –  Ingo Mar 11 '11 at 11:48
    
Are you using windows or Ubuntu right now? –  Lekensteyn Mar 11 '11 at 11:56
    
Ubuntu of course ;) I only had to use Pendrive on Windows when I bought a new computer, and then replaced MS by Ubuntu –  Ingo Mar 11 '11 at 16:05
    
Updated with information about the MBR (optional) and the disk label. –  Lekensteyn Mar 11 '11 at 16:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.