Skip to content

Instantly share code, notes, and snippets.

@Trissolo
Last active September 12, 2025 08:33
Show Gist options
  • Select an option

  • Save Trissolo/e27eec8873b58a01d786371d2d9f36aa to your computer and use it in GitHub Desktop.

Select an option

Save Trissolo/e27eec8873b58a01d786371d2d9f36aa to your computer and use it in GitHub Desktop.

In your firmware, disable:

  •   QuickBoot/FastBoot
    
  •   Intel Smart Response Technology (SRT)
    
  •   Fast Startup
    

https://www.asus.com/it/support/FAQ/1013017/

(If your disk already contains an ESP (eg if your computer had Windows 8 preinstalled), it can be used for Ubuntu too. Do not format it. It is strongly recommended to have only 1 ESP per disk).


An ESP...

...can be created via a recent version of GParted (the Gparted version included in the 12.04 disk is OK), and must have the following attributes:

  •      *Mount point*: /boot/efi
         (remark: no need to set this mount point when using the manual partitioning,
         the Ubuntu installer will detect it automatically)
    
  •      *Size*: minimum 100Mib. 200MiB recommended.
    
  •      *Type*: FAT32
    
  •      *Other*: needs a "boot" flag
    

BIOS settings for Virtualbox:

  • VT-x/AMD-V enabled

Links

https://help.ubuntu.com/community/DiskSpace


https://www.ibm.com/docs/en/license-metric-tool?topic=requirements-disk-space-linux


https://www.asus.com/supportonly/TUF%20GAMING%20B560M-E/HelpDesk_Manual/


https://www.dell.com/support/kbdoc/it-it/000140692/how-do-i-know-what-partitions-to-create-when-installing-red-hat-linux-technical-tip-154224


https://linuxhint.com/boot-partition-size-debian/


PARTITION MINIMUM RECOMMENDED SIZE USAGE
/ 10 GB System files / all files
/boot 256 MB / 512 MB Boot files
/home 100 MB User files
/tmp 50 MB Temporal files
/usr 8 GB Program files
/var 8 GB Dynamic data
  • / (Root): The root partition stores all the systems when the system isn’t partitioned. When the system is partitioned, the root partition stores system files and all files belonging to directories that were not assigned a dedicated partition.
  • /boot: As said previously, the boot partition contains the necessary files to boot the system.
  • /home: The home directory or partition stores user files, such as profile configuration files and all content created by the user. Dedicating a partition to the /home directory will ease backup tasks.
  • /tmp: The tmp partition stores temporary files; dedicating the /tmp directory its own partition is useful to limit the disk space for temporary files.
  • /usr: The /usr partition stores read-only program files, such as executables, libraries, etc. This is similar to the Windows “Program Files” directory.
  • /var: This partition is used for dynamic data, such as log files, cached data, etc. Files located under the /var partition are related to the /usr partition but stored in this different partition since /usr is read-only.

2017-09-02 Recommendations

Name Size Recommended Partition Size
/home 179.5 GB Everything not used elsewhere, or separate drive.
/usr 7.6 GB 10 GB
/var 988.2 MB 2 GB
/lib 599.9 MB 5 GB
/boot 137.1 MB 250 MB
/opt 95.3 MB 500 MB to 5 GB This directory is not used by mainline software packages, but mostly from packages coming from the universe repositories. If you do not use the universe repositories often, you probably will not need much space here.
/etc 18.8 MB 250 MB
/sbin 7.8 MB 250 MB
/bin 6.5 MB 250 MB
/dev 876.0 KB DO NOT PARTITION
/srv 200 KB Unless you plan on installing web served data here, or are using a Server version of Ubuntu, this will not often need to be larger than 100 MB. If you are running a server, or plan to expand it yourself, plan ahead when sizing this.
/tmp 88 KB This can get fairly large, but not larger than your swap space as a rule, so size this to match /swap
/mnt 8 kB (do not partition) This is just an empty directory that serves as a mount point for temporary file systems, e.g. a rarely used network filesystem.
/media 8 kB (do not partition) This contains subdirectories that are mount points for removable media like CDs and USB flash drives.
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

@Trissolo
Copy link
Author

Trissolo commented Mar 2, 2022

software_old
(Last but one is Xarchiver)

BTW, on VirtualBox machine:
lubuntu

sudo apt-get update
sudo apt-get install build-essential gcc make perl dkms
sudo ./VBoxLinuxAdditions.run

whoami
sudo adduser USERNAME vboxsf

/
/

ubu

whoami
sudo usermod -aG vboxsf USERNAME
sudo ls /mount/
sudo chown USERNAME /mount
*/

/*
sudo apt-get update
sudo apt-get install build-essential gcc make perl dkms
whereis flatpack
sudo apt install flatpak
./configure
gimp
sudo snap install gimp # version 2.9.2
gimp
sudo apt-get update
sudo apt-get install gimp-python
sudo snap remove gimp # version 2.9.2
sudo snap install gimp # version 2.8.10
sudo snap autoremove gimp # version 2.8.10
sudo snap remove gimp # version 2.8.10
gimp
whoami
sudo adduser USERNAME vboxsf
whoami
getent group vboxsf
sudo adduser USERNAME vboxsf
sudo usermod -aG vboxsf USERNAME
logout
sudo deluser USERNAME vboxsf
sudo usermod -aG vboxsf USERNAME
sudo ls /mount/
sudo chown USERNAME /mount
*/

image

$ ubuntu-drivers devices

modalias : pci:v000010...
vendor : NVIDIA Corporation
model : GK208B [GeForce GT 730]
manual_install: True
driver : nvidia-driver-418-server - distro non-free
driver : nvidia-340 - distro non-free
driver : nvidia-driver-390 - distro non-free
driver : nvidia-driver-450-server - distro non-free
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-470 - distro non-free recommended
driver : xserver-xorg-video-nouveau - distro free builtin

sudo apt install nvidia-driver-470

nvidia-smi


sudo apt install nvidia-driver-470

@Trissolo
Copy link
Author

Trissolo commented Mar 7, 2022

/etc/default/grub

If you change this file, run 'update-grub' afterwards to update

/boot/grub/grub.cfg.

For full documentation of the options in this file, see:

info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

Uncomment to enable BadRAM filtering, modify to suit your needs

This works with Linux (no patch required) and with any kernel that obtains

the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

Uncomment to disable graphical terminal (grub-pc only)

GRUB_TERMINAL=console

The resolution used on graphical terminal

note that you can use only modes which your graphic card supports via VBE

you can see them in real GRUB with the command `vbeinfo'

#GRUB_GFXMODE=640x480

Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

#GRUB_DISABLE_LINUX_UUID=true

Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY="true"

Uncomment to get a beep at grub start

mem2

GRUB_INIT_TUNE="480 440 1"

@Trissolo
Copy link
Author

Trissolo commented Jul 3, 2022

Partitioning/Home/Moving


Contents

  1. Creating a new partition
    1. Setup Partitions
    2. Find the uuid of the Partition
    3. Setup Fstab
    4. Copy /home to the New Partition
    5. Check Copying Worked
    6. Preparing fstab for the switch
    7. Moving /home into /old_home
    8. Reboot or Remount all
    9. Deleting the old Home
  2. Technical Notes and Resources
    1. Different filesystems on the same disk

Overview

This guide offers detailed instructions for migrating your home directory into its own dedicated partition. Setting up /home on a separate partition is beneficial because your settings, files, and desktop will be maintained if you upgrade, (re)install Ubuntu or another distro. This works because /home has a subdirectory for each user's settings and files which contain all the data & settings of that user. Telling Ubuntu to use an existing home partition can be done by selecting "Manual Partitioning" during the installation of Ubuntu and specifying that you want your home partitions mount point to be /home, ensure you mark your /home partition not be formatted in the process. You should also make sure the usernames you enter for accounts during installation match usernames that existed in a previous installation.

This guide will follow these 8 basic steps:

  1. Set-up your new partition
  2. Find the uuid (=address) of the new partition
  3. Backup and edit your fstab to mount the new partition as /media/home (just for the time being) and reboot.
  4. Use rsync to migrate all data from /home into /media/home
  5. Check copying worked!
  6. Move /home to /old_home to avoid confusion later!
  7. Edit fstab again so the new partition mounts as /home instead of as /media/home
  8. Reboot or remount all. Check system seems to be working well
  9. Delete the /old_home after a while

The guide is written in such a way so that at any point in time if there is a system failure, power outage or random restart that it will not have a negative impact on the system and SHOULD safeguard against the possibility of the user accidentally deleting their home directory in the process.

Creating a new partition

Setting up /home on a separate partition is beneficial because your settings, files, and desktop will be maintained if you upgrade, (re)install Ubuntu or another distro. This works because /home has a subdirectory for each user's settings and files which contain all the data & settings of that user. Also, fresh installs for linux typically like to wipe whatever partition they are being installed to so either the data & settings need to be backed-up elsewhere or else avoid the fuss each time by having /home on a different partition.

Setup Partitions

This is beyond the scope of this page. Try here if you need help. Memorize or write down the location of the partition, something like /sda3. When you do create a new partition it is highly suggested that you create an ext3 or ext4 partition to house your new home directory.

Find the uuid of the Partition

The uuid (Universally Unique Identifier) reference for all partitions can be found by opening a command-line to type the following:

sudo blkid

Alternative Method

For some older releases of Ubuntu the "blkid" command might not work so this could be used instead

sudo vol_id -u

for example

sudo vol_id -u /dev/sda3

Now you just need to take note (copy&paste into a text-file) the uuid of the partition that you have set-up ready to be the new /home partition.

Setup Fstab

Your fstab is a file used to tell Ubuntu what partitions to mount at boot. The following commands will duplicate your current fstab, append the year-month-day to the end of the file name, compare the two files and open the original for editing.

1. Duplicate your fstab file:

sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)

2. Compare the two files to confirm the backup matches the original:

cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)

3. Open the original fstab in a text editor:

sudo gedit /etc/fstab

and add these lines into it

# (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings)
UUID=???????? /media/home ext3 defaults 0 2

and replace the "????????" with the UUID number of the intended /home partition.

NOTE: In the above example, the specified partition in the new text is an ext3, but if yours is an ext4 partition, you should change the part above that says "ext3" to say "ext4", in addition to replacing the ???'s with the correct UUID. Also note that if you are using Kubuntu, Xubuntu or Lubuntu you may need to replace "gedit" with "kate", "mousepad" or "leafpad", respectively. They are text editors included with those distributions.

4. Save and Close the fstab file, then type the following command:

sudo mkdir /media/home

This command will create a new directory, later used for temporarily mounting the new partition. At the end of the procedure this directory can be removed.

Now you can restart your machine or instead of rebooting you might prefer to just re-load the updated fstab

sudo mount -a

Either should have mounted the new partition as /media/home. We will edit the fstab again later so this arrangement of the partition is only temporary.

Copy /home to the New Partition

Next we will copy all files, directories and sub-directories from your current /home directory into the new partition. If you do not have an encrypted home file system, just do the following:

sudo rsync -aXS --exclude='/*/.gvfs' /home/. /media/home/.

I prefer adding the "--progress" tag just before the "--excludes" one - otherwise there is no indication of anything happening. The "--progress" tag reports on each file individually so you see tons of unfamiliar stuff scrolling by very fast. Rsync can be interrupted as many times as you like and it checks to see how much has already been done when you start it up again. So, this copying stage can be broken down into many sessions. After it has completed once it's wise to run it a couple more times just to make sure it includes everything you may have added since first starting the first copying/syncing session - even if you've done the whole thing all in just one session.

The --exclude='/*/.gvfs' prevents rsync from complaining about not being able to copy .gvfs, but I believe it is optional. Even if rsync complains, it will copy everything else anyway. (See here for discussion on this)

Encrypted file systems

If you have an encrypted home file system, then the above will just leave you with an unencrypted copy of your files, which is probably not what you want. You could re-encrypt them after copying, or copy them in their encrypted form. Here is one way to do that.

First, you'll need to shut down, and reboot from a LiveCD or USB stick. Then you'll need to mount your root partition and new home partition. (You can do this by selecting those devices in the file viewer). They will be mounted under /media/ubuntu - so for example, if you named your root partition linux-root, then your old home directory will be found at /media/ubuntu/linux-root/home. And if you named your new home partition linux-home, then this will be found at /media/ubuntu/linux-home. So, now you can copy your encrypted home files (here assuming your partitions are named linux-root and linux-home):

sudo rsync -aXS /media/ubuntu/linux-root/home/. /media/ubuntu/linux-home/.

There is no point trying to exclude any files with specific names, because the names of the files are encrypted too!

Leave your machine running from the LiveCD or USB for the moment.

Check Copying Worked

You should now have two duplicate copies of all the data within your home directory; the original being located in /home and the new duplicate located in /media/home. You should confirm all files and directories copied over successfully. One way to do this (for an unencrypted file system) is by using the diff command:

sudo diff -r /home /media/home -x ".gvfs/*"

If you are doing this from a LiveCd or to an existing partition that already has stuff on it you may find differences but hopefully it should be obvious which diffs you can ignore.

You can also expect to see some errors about files not found. These are due to symbolic links that point to places that don't presently exist (but will do after you have rebooted). You can ignore these - but check out anything else.

Encrypted file systems

If you have an encrypted file system, the command will look more like this.

sudo diff -r /media/ubuntu/linux-root/home /media/ubuntu/linux-home

Now you can shut-down, remove the LiveCD / USB stick, and reboot as normal.

Preparing fstab for the switch

We now need to modify the fstab again to point to the new partition and mount it as /home. So again on a command-line

sudo gedit /etc/fstab

and now edit the lines you added earlier, changing the "/media/home" part to simply say "/home" so that it looks like this:

# (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings)
UUID=???????? /home ext3 defaults 0 2

Then, press Save, close the file but don't reboot just yet.

Moving /home into /old_home

Backing up your old home, just in case things have not gone completely smoothly, is best done right now. Here is how:

As long as you have not rebooted yet, you will still see 2 copies of your /home directory; the new one on the new partition (currently mounted as /media/home) and the old one still in the same partition it was always in (currently mounted as /home). We need to move the contents of the old home directory out of the way and create an empty "place-holder" directory to act as a "mount point" for our new partition.

Type the following string of commands in to do all this at once:

cd / && sudo mv /home /old_home && sudo mkdir /home

By default, when you open a terminal window it places you within your home directory. Typing cd / takes us to the root directory and out of home so we can then use the sudo mv command to essentially rename /home into /old_home, and finally create a new, empty /home placeholder.

Reboot or Remount all

With;

  1. your fstab now edited to mount your new partition to our /home place-holder and
  2. the original /home now called /old_home,

it should be a good time to reboot your computer to check the whole thing really did work. Your new partition should mount as /home and everything should look exactly the same as it did before you started.

Btw, geeks might prefer to avoid rebooting by just re-loading the updated fstab

sudo mount -a

There is no need to reboot - unless you have an encrypted file system.

Troubleshooting

If you receive an error like 'The volume may already be mounted', use the following command to unmount the drive first before re-doing the last step again. (note the "n" should be missing from the command, making it "umount")

sudo umount /media/home/

Then try mounting again

sudo mount -a

Deleting the old Home

You can keep using the system as it is for ages before doing this, unless you are desperately short of space on the / partition. It's probably best to leave this step until a long time after you have been using the system happily. When you do eventually feel safe enough to delete the old home then you can try;

cd /
sudo rm -rI /old_home

Be careful with the above command because mis-typing it could result in the deletion of other files and directories!

Technical Notes and Resources

Rsync was chosen over cp and find|cpio because it seemed to maintain permissions.

http://ubuntu.wordpress.com/2006/01/29/move-home-to-its-own-partition/

http://ubuntuforums.org/showthread.php?t=46866

Different filesystems on the same disk

If you're moving from Windows and your new home partition is going to be an old ntfs partition (the D: disk) while you convert the C: disk to a journaling partition where you install Linux, this won't work, there will be a huge load on the processor. You should convert the two partitions to ext3 or ext4 or keep both partitions as ntfs (I haven't checked this last option). But working with two different filesystems on the same drive simultaneously doesn't seem to be a good option.




To fix grub rescue go with following steps:

  • First thing is we have to start our OS only then after we can fix grub.

    #to start OS-->
    error: unknown filesystem.
    Entering rescue mode...
    grub rescue>
    

    When you see such an error first we have to check for “Filesystem” is ext2'

    grub rescue> ls        # type 'ls' and hit enter to see drive partition.
    (hd0) (hd0,msdos6) (hd0,msdos5) (hd0,msdos4) ...   # you will see such things 
    

this are our drives now we have to check which one is ext2.

grub rescue>ls (hd0,msdos6)
error: disk 'hd,msdos6' not found.

go for another drives until you get “Filesystem is ext2”.

grub rescue>ls (hd0,msdos5)
error: disk 'hd,msdos5' not found.
grub rescue>ls (hd0,msdos2)
(hd0,msdos2): Filesystem is ext2        # this is what we want

now set the path

grub rescue>set boot=(hd0,msdos2)
grub rescue>set prefix=(hd0,msdos6)/boot/grub
grub rescue>insmod normal
grub rescue>normal
  • Now just fix grub by following command on any Ubuntu

    sudo grub-install /dev/sda
    sudo apt-get update
    # to update grub
    sudo apt-get upgrade
    

make sure you must update grub after login into OS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment