Answers
This is the 25th Anniversary edition of Linux Format and its Answers pages, so here’s a selection of some of the more common and interesting questions we have received.
Neil Bothwick takes a well-earned rest and lets his brain cool down.
Q
Memory loss
I have forgotten my root password. Is there a way to reset it or will I have to reinstall?
Alex Wade
A All is not lost – there is no need to reinstall. There are at least three ways to reset the root password that we can think of: sudo, single-user boot or a live distro. All of them are ways of becoming root without the root password, so that you can then reset it. The simplest, if your distro is set up to use sudo with suitable permissions, is to run: $ sudo -i
This runs an interactive shell as root, from which you can run the following to set a new password: $ passwd
If sudo is configured to block this option (it is insecure), you can try booting in single-user mode. Reboot the computer and at the boot menu, press e to edit the boot options. If you are running systemd, add systemd.unit=emergency.target to the end of the kernel options, otherwise either single or emergency should do the job. As a last resort, try init=/bin/ sh . One of these will boot you into a root shell, from where you can run the passwd command. If passwd complains about the root filesystem being mounted read-only, run the following to remount it read/write: $ mount /-o remount,rw
Being able to gain root access like this is a security risk if physical access to your computer is possible, so your GRUB menu may be password-protected. If you can remember that password, fine, but if it is the same as the root password, or you are having serious memory problems, you may need to go with the third option.
Boot from a live distro – it could be a rescue distro or just a normal live desktop; use whatever is to hand. Open a terminal and become root in the live environment; use the sudo -i option if this is an Ubuntu-ish distro – they allow passwordless sudo on the live discs. Now mount your distro’s root partition. We’ll use /dev/sda1 for our example here but it is wherever your distro is installed. Then you can chroot into the distro – which just means setting the root of the distro as your shell’s operating environment and running the command given – and run passwd: $ mkdir -p /mnt/distro
$ mount /dev/sda1 /mnt/distro
$ passwd --chroot /mnt/distro
Now your new password should be written to the /etc/shadow file on your distro. Reboot to try it out – and try not to forget it this time!
Q
Big not FAT
I have some very large files I want to move to an external hard drive, but I get an error when I try to copy files much over 4GB. I realise now that I should have re-formatted it to NTFS format when it was new, but it is too late now as it has too much stuff on it.
I have found out about the split command, but this seems to be for files with lines in them, unlike mine. Also, I have not been able to get a clear idea of what actual prefixes and suffixes to use. Please note that I want to be able to put the file back together again in 10 or more years’ time, so I need commands that are likely to be around for a long time.