Created
November 23, 2021 17:15
-
-
Save scottstanfield/cb8bbe2f4591202372c60a560d32ba2b to your computer and use it in GitHub Desktop.
Revisions
-
scottstanfield created this gist
Nov 23, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ # Grub boot linux manually (hold shift or ESC) ``` set pager=1 cat /boot/grub/grub.cfg set root=(hd0,gpt2) linux /boot/vmlinuz-5.4.0-45-generic root=UUID=0ad8dbaf-6d97-4836-8fa5-612c7e5021c6 ro recovery nomodeset initrd /boot/initrd.img-5.4.0-45-generic boot ``` # Safe boot to console now https://linuxconfig.org/how-to-move-var-directory-to-another-partition # attach new HD to SATA port and boot ```bash sudo su # run all as root or prepend with sudo lsblk # look for new drive like /dev/sdb fdisk /dev/sdb # create *partition*: n p p print partition d delete n new (p, enter, enter) w write <enter> w mkfs.ext4 /dev/sdb1 # format first partition mkdir /mnt/home mount /dev/sdb2 /mnt/home sudo mkdir /mnt/newdrive sudo mount /dev/sdb2 /mnt/newdrive # now move var sudo du -hs /var sudo rsync -aqxP /var/* /mnt/newdrive # Add new line to bottom of /etc/fstab nano /etc/fstab /dev/sdb1 /var ext4 defaults 0 2 sudo mount -a # now /var is remapped but old var is full # final step is clean boot off USB Linux, map old drive # and rm -rf /var ```