1

I apologize for the vague information that was here previously. I was posting from my phone, i am now using my USB of Ubuntu i 'try' mode. Basically, I use a SSD for my install of Ubuntu 18.04. It is only 250GB and since Ubuntu is my daily driver I wanted to move my /home directory to my 1TB hdd so I would have more space for files. These are the steps I followed:

# To temporarily mount the new partition
sudo mkdir /mnt/tmp
sudo mount /dev/sda1 /mnt/tmp

# Copy HOME to the new location
sudo rsync -avx /home/ /mnt/tmp
sudo mount /dev/sda1 /home

#this is where i had an error
sudo umount /home #got message that device is busy and cannot unmount

# the guide i followed said to unmount and then use rm -rf /home/* but i used
rm -rf /dev/nvme0n1 /home/*
# I got error: this directory is not empty, the guide i used said to reboot if this happened.

#Make HOME permanent
sudo blkid
#copy UUID, then paste in fstab
sudo nano /etc/fstab

#add following line at the end
UUID=<noted number from above>     /home    ext4     defaults    0    2

#then reboot

From rereading the guide I see a mistake i made, where I just removed the UUID on the line that was already present with '/home' in it and replaced it with the UUID for the new drive.

but after that I rebooted and now my computer just goes straight to BIOS and cannot find any bootable drives.

Output of sudo fdisk -l

Disk /dev/loop0: 1.8 GiB, 1905045504 bytes, 3720792 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 91 MiB, 95408128 bytes, 186344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 34.6 MiB, 36216832 bytes, 70736 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 140.7 MiB, 147496960 bytes, 288080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 2.3 MiB, 2355200 bytes, 4600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 13 MiB, 13619200 bytes, 26600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 14.5 MiB, 15208448 bytes, 29704 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 3.7 MiB, 3878912 bytes, 7576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/nvme0n1: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 611E8FFB-79C8-4D36-A5F7-F177138D442B

Device            Start       End   Sectors   Size Type
/dev/nvme0n1p1     2048    999423    997376   487M Linux swap
/dev/nvme0n1p2   999424  24436735  23437312  11.2G Linux filesystem
/dev/nvme0n1p3 24436736 488396799 463960064 221.2G Linux filesystem


Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: E4025E76-690C-4779-BBBD-0996D3C7146E

Device     Start        End    Sectors   Size Type
/dev/sda1   2048 1953523711 1953521664 931.5G Linux filesystem


Disk /dev/sdb: 57.9 GiB, 62109253632 bytes, 121307136 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x65092a4c

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1  *     2048 121307135 121305088 57.9G  c W95 FAT32 (LBA)


Disk /dev/sdc: 7.5 GiB, 8021606400 bytes, 15667200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x40993ab6

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdc1  *          0 3899391 3899392  1.9G  0 Empty
/dev/sdc2       3830956 3835883    4928  2.4M ef EFI (FAT-12/16/32)

I just tried doing sudo gedit then opening the fstab file and editing it by putting the UUID of the partition with /home on it in the file where i had edited it. when i rebooted, same thing, no bootable devices.

Here is the output of Boot-Repair as requested http://paste.ubuntu.com/p/rVGCm8pYp7/ ---updated the other one was messed up because of a flashdrive that was plugged in.

I see what I did, when trying to set up my secondary harddrive for use as a data drive, I reformatted it before trying these steps. In doing so i must have formatted the EFI partition on that drive as well so UEFI boot cannot find it.

Brett Plemons
  • 89
  • 1
  • 9
  • 1
    Please run Boot-Repair and report the URL provided by it if it does not solve your problem automatically. Your current question is quite unclear: What didn’t let you delete your old home directory? What was the error message? Where did you change the UUID, why and how? Please [edit] your question to make it clear and answerable. – Melebius Mar 25 '19 at 14:53
  • i know i need to edit the fstab and fix what i messed up but i cant figure out how to open the fstab where it is editable. I tried just mounting the partition and opening in gui, clearly that was read only. I tried 'sudo nano
    /etc/fstab' but it opened a blank file so im guessing it just opened the gone for my flashdrive. i am so lost here.
    – Brett Plemons Mar 25 '19 at 15:19
  • Is this the guide you followed? It normally works, but you cannot skip any steps and if errors must stop & fix first. https://help.ubuntu.com/community/Partitioning/Home/Moving If from live installer you have to make a mount point and mount partition to that: sudo mkdir /mnt/newhome & sudo mount /dev/sdb1 /mnt/newhome – oldfred Mar 25 '19 at 15:33
  • So i am in the live installer on my USB drive. I used disks to mount the partition with my Ubuntu install. i can navigate to and open the fstab file from the gui, obviously i cannot edit the fstab this way. And when i try to do it from the terminal with sudo nano /etc/fstab it opens the one for the live installer – Brett Plemons Mar 25 '19 at 15:36
  • also that is not the one i followed. If i can get this fixed then i will start over and follow that guide – Brett Plemons Mar 25 '19 at 15:39
  • 2
    Why did you put /dev/nvme0n1 in that remove command? – rtaft Mar 25 '19 at 15:47
  • to removed the /home from that mounted drive – Brett Plemons Mar 25 '19 at 15:50
  • From the Live CD, please post the output of sudo fdisk -l – rtaft Mar 25 '19 at 15:54
  • @BrettPlemons why aren't you using the Live CD to run Boot-repair (like Melebius asked)? I don't understand? we'd be so much further if you did (as in there's a 95% chance your problem would be gone). sudo add-apt-repository ppa:yannubuntu/boot-repair -y && sudo apt update && sudo apt-get install -y boot-repair && boot-repair – tatsu Mar 25 '19 at 16:05
  • sorry, i didnt know what boot-repair was. I am doing it now. will be up in a moment – Brett Plemons Mar 25 '19 at 16:08
  • I'm guessing you damaged the MBR when you had /dev/nvme0n1 in the remove, though I can't reproduce that with /dev/sda on a VM. – rtaft Mar 25 '19 at 16:14
  • should I run the repair from boot-repair? – Brett Plemons Mar 25 '19 at 16:15
  • yes, repair it. – rtaft Mar 25 '19 at 16:26
  • it gives an error, GPT detected. Please create a BIOS-Boot partition (>1MB, unformatted filesystem, bios_grub flag). This can be performed via tools such as Gparted. Then try again. Does this need to be on nvme0n1? if so will changing the size of my linux-swap file system to put that at the beginning damage my OS even more? – Brett Plemons Mar 25 '19 at 16:27
  • Try this instead https://askubuntu.com/questions/546582/surface-pro-3-no-grub-menu/604238#604238 Using grub from the live cd, force it to boot to /dev/nvme0n1p2, then run grub-install once in Ubuntu. You just need to figure out which hd# to use. – rtaft Mar 25 '19 at 16:41
  • that didnt work, my nvme drive isnt listed in grub, im assuming that is because it doesnt have an efi partition – Brett Plemons Mar 25 '19 at 16:55

1 Answers1

3

Okay guys, I figured it out with help from rtaft. Thank you very much.

So to start, Do not format the hdd that had your windows install if you have UEFI boot....... it will make it so your computer doesnt know how to boot. This is because the default ubuntu installer will use the existing EFI to boot with rather than creating one.

So, thankfully I did a custom partitioning in my install so i had about 400mb of empty space in the start of my nvme drive for linux swap. so i just reduced the size of that to 200mb. It was then partitioned using Gparted as unformatted with bios_grub flag.

From there i just ran boot-repair recommended repair and it installed grub in that unformatted partition. And now my computer boots like normal.

Thank you all for your help.

Brett Plemons
  • 89
  • 1
  • 9