To check if you are currently running Arch Linux, and whether it's from your PC's internal storage or a USB drive, you can use a few commands.
Checking if you have Arch Linux running
The most definitive ways to check for Arch Linux involve looking for its unique package manager (pacman) or its distribution identification files.
1. The Definitive Check: pacman
Arch Linux uses pacman as its package manager. If pacman is available and functional, you are almost certainly running Arch Linux or an Arch-based distribution (like Manjaro).
which pacman
- Expected output if Arch:
/usr/bin/pacman or similar.
- If not Arch: No output or an error message like
pacman not found.
You can also try:
pacman --version
- Expected output if Arch: Shows
pacman version information.
- If not Arch: Error.
2. The Standard Linux Way: /etc/os-release
Most modern Linux distributions include the /etc/os-release file, which provides standardized OS identification.
cat /etc/os-release
3. Simpler Check: /etc/issue
This file often contains a brief description of the operating system.
cat /etc/issue
- Expected output if Arch: Often just
Arch Linux or Arch Linux \r (\l).
- If not Arch: It will show the name of the other distribution.
4. Kernel Information: uname -a
While not foolproof, the kernel name sometimes includes distribution-specific branding.
uname -a
- Expected output if Arch: You might see
ARCH or arch within the kernel string (e.g., Linux archlinux 6.X.X-arch1-1 #1 SMP PREEMPT_DYNAMIC ...).
- If not Arch: The kernel name usually reflects the distribution you're running (e.g.,
generic for Ubuntu, fc for Fedora).
5. Bonus: neofetch (If installed)
If you have neofetch installed (you might need to install it with sudo pacman -S neofetch if you confirm it's Arch), it provides a beautiful summary of your system, including the OS.
neofetch
- Expected output if Arch: A fancy ASCII logo of Arch Linux with system details.
Checking if it's from PC or USB
This is a bit trickier from within the running OS itself, as the OS doesn't inherently distinguish between "internal" and "external" storage in terms of its core identity. However, you can infer it by looking at the device your root filesystem is mounted on.
1. Check Root Filesystem with df -h or findmnt
df -h /
This command shows the disk space usage for the root filesystem (/). Pay attention to the "Filesystem" column.
findmnt /
This command shows more detailed information about the mount point /.
- Look for: The device name (e.g.,
/dev/sda1, /dev/nvme0n1p2, /dev/sdb4).
/dev/sdX (where X is a letter like a, b, c) typically refers to SATA drives or USB drives.
/dev/nvme0n1pX refers to NVMe SSDs (usually internal).
- The crucial part is identifying which of these is a USB drive.
2. List all Block Devices with lsblk
lsblk (list block devices) shows information about all available disk drives and their partitions in a tree-like format.
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,ROTA
-
NAME: Device name (e.g., sda, sdb, nvme0n1).
-
SIZE: Size of the device.
-
TYPE: disk for whole disks, part for partitions, rom for CD/DVD drives, loop for loop devices.
-
MOUNTPOINT: Where it's mounted. Look for the / (root) mount point.
-
ROTA: Rotational device (1 for HDD, 0 for SSD/Flash). This can help distinguish older HDDs from SSDs/USB drives.
-
How to tell PC vs. USB:
- Internal drives are typically
/dev/sda, /dev/sdb, or /dev/nvmeX and are usually larger (hundreds of GBs to TBs). They will often have multiple partitions.
- USB drives are usually identified as
/dev/sdX (where X is a letter after your internal drives, e.g., if your internal is sda, the USB might be sdb or sdc). They are generally smaller (e.g., 8GB, 16GB, 32GB, 64GB, 128GB, 256GB). If your root filesystem (/) is mounted on one of these smaller /dev/sdX devices and you know you have an internal drive, it's highly likely it's a USB.
- Live USBs: If it's a live USB that isn't persistent, you might see
squashfs or loop devices involved in the findmnt / output, which is typical for a live environment loaded into RAM from a USB.
Example Scenario:
Let's say lsblk output looks like this:
NAME SIZE TYPE MOUNTPOINT ROTA
sda 931.5G disk 1
├─sda1 512M part /boot/efi 0
└─sda2 931.0G part / 0
sdb 14.9G disk 0
├─sdb1 4.5G part 0
└─sdb2 10.4G part 0
In this example:
/dev/sda is a 931.5GB disk, and sda2 is mounted at /. This indicates it's likely an internal drive (a large HDD or SSD).
/dev/sdb is a 14.9GB disk. If your system was running from sdb, and it's a smaller device, it would strongly suggest you're running from a USB drive.
In summary:
- Confirm Arch: Use
pacman --version or cat /etc/os-release. These are the most reliable.
- Infer PC vs. USB: Use
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,ROTA and look at the MOUNTPOINT for /. If it's a smaller /dev/sdX device, it's likely a USB.