Score:1

How can I clean my Ubuntu USB installation key after installation?

in flag

Last month, I installed Ubuntu from a USB key. The key has a large capacity and a ton of other files and directories from various apps. But every time I reboot my computer with the key in it, it goes to the installer again, so I want to get rid of the Ubuntu installer that is present on that key, but I don't know which files and directories are related to Ubuntu and those linked to other apps I used.

What are the directories and files at the root directory of an installation key that are related to the installer, so that I can safely remove those and keep using my key without the installer on it. I do not have a second key on which to place the installer to compare by myself.

Are there other things on the key that I should be aware of? I think about hidden partitions or stuff like that.

Here is how I proceeded:

  1. I had data on my Windows machine.
  2. I created a USB insallation USB drive with Rufus.
  3. I wanted to keep some data from Windows to Linux, so I copied that data directly on my USB installation drive. I made sure there was no directory name overlap. Here, I should have copied it in a "My personal data" directory for ease, but I didn't think of that.
  4. I installed Linux, getting rid of my Windows system and data.
  5. I now have my data mixed with my Linux installation files on my USB drive.
cocomac avatar
cn flag
If you put files in the installer drive, but want to keep those files on the drive, but remove the installer, the easiest way is probably to copy those files to a safe place, [wipe the drive](https://askubuntu.com/q/185815), and then put the files back on the drive
Olivier Grégoire avatar
in flag
@cocomac The point is that I don't know which files belong to the installer and which ones belong to my various apps. I would like to also bet back the 3.5 GB of the installation. If I just move all the files, wipe my drive, and put all the files back, I'm still at a point where 3.5 GB are useless.
oldfred avatar
cn flag
How did you create installer on USB flash drive? If you used dd or similar, you erased partition table and made it extremely difficult to recover other data on drive. If you just want to use drive, you need to erase the beginning of drive where partition table is, so you can create new partition table. The dd copy overwrites the partition table with just data as it is a hybrid DVD/flash drive install. https://askubuntu.com/questions/939230/formatting-a-usb-stick-unable-to-operate-usb/939266#939266 & https://help.ubuntu.com/community/mkusb#Re-use_the_pendrive
Olivier Grégoire avatar
in flag
@oldfred I updated my question with that information.
oldfred avatar
cn flag
I have not used Rufus, but gather it has several ways to make USB flash drive installer. The installer is either a FAT32 formatted partition that cannot be modified or a hybrid DVD/Flash drive installer. You would not have any of your data int the actual live installer. When you install, that typically erases the partition you install / (root) into, unless you select otherwise (no format of / ext4 partition).
Olivier Grégoire avatar
in flag
@oldfred the fact is that I have my data in it. I recognize some directories but not all. So please don't speculate about whether I have or not my data on the flash drive.
Olivier Grégoire avatar
in flag
All I'm asking is whether someone has an installation flash drive and type `ls` and give me back that result so I can remove that list of files from my own drive
oldfred avatar
cn flag
I have not used flash drives in ages to install. I use grub2's loopmount to directly mount the ISO. But you can manually mount the ISO and see all the files & folders (a lot) in the ISO which is then what is on live installer. In Kubuntu, I right click & choose mount, otherwise it defaults to k3b & wanting to write it. Note some folders & many files are the same as your install, so just deleting those may delete your install.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.