Linux+: Linux Install 12 – Removing Linux

J

Jarret W. Buse

Guest
Linux+: Linux Install 12 – Removing Linux

Before getting in on removing the Linux Operating System (OS), let's take a look at the installation in a different way.

During the install, the user is asked to specify the location of the various mount points. Only the Root and the Swap partitions are needed to be specified. If only the Root and Swap are specified, then all other mount points are placed in the same partition together. The mount points can be placed on separate partitions and even on separate drives.

Let's look at the various Mount Points in more detail:

/bin/ – contains the system files necessary for OS functionality. These are the executable files of the basic commands needed by the users.
/boot/ – files need to boot Linux with very basic support. Also contains the kernel and boot files.
/cdrom/ – used as a mounting point for the CD-ROM, but is now mounted under /media.
/dev/ – contains the devices on the system recognized by Linux. Each device is a file, such as /dev/sda. Here, sda represents the first disk drive.
/etc/ – this is the folder containing all of the configuration files for the OS.
/home/ – contains a folder named for each user where their documents and settings are kept for that specific user.
/lib/ – used to store system files for the Linux OS which are .so files similar to Windows .dll files.
/lost+found/ – if a system crash occurs any recovered files are placed in this folder.
/media/ – used to list the mounted devices.
/mnt/ – contains the mounted devices. Most distros now use /media.
/opt/ – location for installed applications, but this is not used by all distros.
/proc/ – a virtual folder which contains the process information of the OS such as memory, devices, bus information and other items.
/root/
– home directory for root user.
/run/ – information about currently running services and current user.
/sbin/ – system files are stored here for use by the root user. These files require root privileges to be executed.
/srv/ – mostly unused in recent distros, it was used to keep site specific information for protocols such as FTP and other services.
/swap/ – used for swap files in distros which use swap files instead of swap partitions.
/sys/ – similar to /proc, but used for Plug and Play (PnP) device configuration
/tmp/ – storage for temporary files need by the OS or applications.
/usr/ – contains the application binaries for all users.
/var/ – has all files which change as the system is running such as cache, spools, logs and other items.

Some of these Mount Points are “re-usable”. That is, the Mount Point can be used by multiple Operating Systems. For example, the Swap partition can be used among all Linux distros. The following list shows the Mount Points which can be shared among various distros:

  • /boot/ - Allows for the same boot loader to be used and configured in one place. If each distro contains the /boot/ on the same partition, then each boot loader is separate.
  • /home/ - All documents and personal settings are stored in one place for all distros
  • /swap/ - Reduces the amount of space needed by an OS since the swap partition is separate. One partition is made and used for all distros as a swap partition.
  • /root/ - Same as /home/ but stores information for the root user.
  • /var/ - Stores temporary files for the OS.
Some other Mount Points which may be possible to share among distros, but not suggested because problems may occur:

  • /usr/ - The binaries are contained here, but there could be differences between the distros which may not work.
  • /bin/ - Executable files used by the OS may not be the same among all distros.
  • /lib/ - The files stored here may also vary between distros. Some files may work on one distro, but not another.
  • /opt/ - Not all distros store files here and because of this, it may not work.
  • /sbin/ - These files are for the root user, but may vary between the distros.

Now, to remove an installed Linux Operating System you need to remove all mount points and not just the Root.

There are two commands which can be used in Terminal to determine the Mount Points.

The first is 'df -h' which shows the following sample output:

jarret@jarret-Presario-CQ62-Notebook-PC:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 72G 9.8G 59G 15% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 387M 1.2M 386M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 492K 1.9G 1% /run/shm
none 100M 64K 100M 1% /run/user
/dev/sda2 1.5G 36M 1.3G 3% /boot
/dev/sda3 48G 12G 34G 26% /home

Here, you can see that sda1 contains the root of the OS. The sda2 partition holds the boot Mount Point and sda3 is the home Mount Point. The swap partition is not shown here.

NOTE: It may be best to use both commands to verify that all partitions are listed.

The second command is 'cat /etc/fstab' with sample output following:

jarret@jarret-Presario-CQ62-Notebook-PC:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=7c08c477-0ed4-4794-b847-982bce578592 / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda2 during installation
UUID=ba8bb222-1606-4875-a924-c2b905840e62 /boot ext4 defaults 0 2
# /home was on /dev/sda3 during installation
UUID=7708003f-c85b-4c87-8bb9-d5c0357092bb /home ext4 defaults 0 2
# swap was on /dev/sda10 during installation
UUID=2cf8738e-1c13-46f8-b263-5fe46f0da5ca none swap sw 0 0
# swap was on /dev/sda9 during installation
UUID=4236dabb-fa7d-4066-b171-91ffa7afb4f4 none

Here, you can see there is another swap partition on sda9 as well as sda10.

NOTE:
On multi-boot systems, you will not need to delete the swap partition.

Make note of the Mount Points and remove data of the Mount Points not needed. Whole partitions can be removed using GParted. Individual folders can be removed using a File Manager.

NOTE: You may need to start the File Manager with Root user privileges.

Once the Root of the OS is removed, then the OS is deleted. Be aware that Mount Points placed in other partitions, which are not shared with another distro, should be removed as well.
 

Attachments

  • slide.jpg
    slide.jpg
    42.4 KB · Views: 66,728

Members online


Top