Ubuntu Pastebin

Paste from e at Fri, 13 Jan 2017 15:45:35 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-boot live usb
*sudo parted -l
-get the name of the disk that has 90G free
example
Model: ATA Hitachi HTS54757 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type      File system     Flags
 1      32.3kB  296MB  296MB   primary   fat32           esp
 2      296MB   100GB  100GB   primary   ext4

first partition will be disk name + number, /dev/sda1 2nd partition /dev/sda2
*sudo mkdir /ubuntuinstall
-mount the partition "sudo mount /dev/sdxY /mnt"
-mount the partition of ubuntu "sudo mount /dev/sdxY /ubuntuinstall"

*cd /mnt
*fallocate -l 90G disk.img
*sudo fdisk disk.img
press "o" then enter, then "w" then enter
*sudo cfdisk disk.img
press new, enter enter enter til done then press write then quit
*sudo losetup -f disk.img
*sudo partx -a /dev/loop0
*sudo mkfs.ext4 /dev/loop0p1
*sudo mkdir /ubuntudisk
*sudo mount /dev/loop0p1 /ubuntudisk
*sudo rsync -av /ubuntuinstall/ /ubuntudisk   
(the trailing "/" after ubuntuinstall is important!)

*for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /ubuntuinstall$i; done
*sudo chroot /ubuntuinstall
*grub-install --recheck /dev/loop0
*update-grub
*exit
Download as text