I`m not very experienced with Linux, however, there are a lot of inforamtion around, so I can usually learn what I need. I never understood, however, what "mounting" means in Linux. While using Windows I would simply plug in something (say, a USB pendrive) and then windows would ask me "Hey, do you want to browse that?", clearly Windows does something that I should know how to do but I don't fully understand.
If you've used Zip or RAR archives, mounting a disk is somewhat similar to opening such an archive. The largest difference is that it's done by the operating system itself (not by a separate program).
- When you open an archive, you basically tell some program to read the .zip file's contents and allow accessing the archived files inside.
- When you mount a disk, you tell the OS to read the disk's contents and allow accessing the files inside.
Windows, being primarily a desktop OS and having the "desktop" part fully integrated, takes care of mounting disks automatically. On Linux, in most desktop environments, it's also automatic, but Linux just allows stripping away the "desktop" and all its automation, depending on the needs. (Linux is just the kernel, everything else already comes as separate components.) For example, it's used on servers that don't have or need USB ports, on routers, on TVs, on mobile phones... Various "rescue" CDs, like SystemRescueCd, also avoid auto-mounting because of possible risks – e.g. if one is trying to recover data from a corrupted disk, then trying to mount it might corrupt it even more.
The problem is, to mount something I do (copy and paste, mind you)
mount /dev/fd0 /mnt/FolderIJustCreated
However, this time it doesn't work, since it doesn't recognize the HD type, and I can't help it by feeding -t since I also don't know what's the HD type. I mean, it was supposed to be fat32, but I think the encryption destroys that. So, How could I mount this typeless HD?
First make sure you're pointing it at the HD.
/dev/fd0 always means the zeroth floppy disk. Hard disks are usually named
/dev/sdb... (On older Linux versions, they were
/dev/hdb, ... – I don't know how old is SystemRescueCd.)
Also, most of the time you'll need to point
mount at a specific partition on that disk. Even if there was only one partition, it still has a separate device node: if the entire disk is
/dev/sda, then its partitions will be
/dev/sda2, and so on. The HD as a whole doesn't have a "type"; instead, each partition does. Or even more precisely, the filesystems existing in each partition have types like FAT32 or ext2.
Second, yes, if the disk was encrypted, then you cannot mount it directly: you must unlock it first. There cannot be a single answer on how to do that, since you haven't told which program was used to encrypt it – BitLocker? TrueCrypt? LUKS? Something entirely different? Some of them only work on Windows, too.
However, if all you want is to discard all existing data on the disk and to format it anew, then mounting is not needed anyway. You can create a new, empty filesystem – in other words, format the disk – using
mkfs; see below.
Before doing that, you might need to delete all partitions and create a new empty one. It's not necessary in all cases though – if the
print commands below show just one partition covering the entire disk space, then the other steps can be skipped, and the partition can be formatted directly. But some disk encryption programs might have altered the partition table in unusual ways.
After this, you should have a disk with one partition covering the entire disk's space. If the disk was
/dev/sda, this partition will be
/dev/sda1. It currently just has garbage in it (leftovers of the encrypted data), so create a filesystem by using one of the
To create a FAT32 filesystem, run
To create a NTFS filesystem, run
Or, if SystemRescueCd does not have
mkfs.ntfs, connect the disk to a Windows computer and use the "Format" option there.
NTFS can be a little more difficult to use on Linux, and can cause trouble when used on USB drives even on Windows. On the other hand, it's much more reliable than FAT32, especially on large disks.
After this step,
/dev/sda1 can be mounted and used.
Furthermore, I never understood where the "/dev/fd0" part came from, does that mean that the thing I'm mounting is already on my system in the folder /dev/ ?
Yes. On Linux, many devices can be accessed through special files (device nodes) in /dev/ – if a program reads from
/dev/fd0, it will see the raw data stored in the floppy disk (bypassing any filesystems); likewise, it can access the HD's contents through
/dev/sda (and partitions such as
/dev/sda1), control the computer's clock through
/dev/rtc0, the screen's contents through /dev/fb0
, play audio by writing to/dev/snd/pcmC0D0p`.
mkfs.* programs use this to edit the partition table or to create new filesystems.
(On Windows, many devices have similar names too – e.g.
\\.\Device\Harddisk0\Partition0 – but they are somewhat more separated, and cannot be seen in any folder.)
Since the device nodes appear as files, they often are used as such – e.g.
/dev/zero is used as an endless source of zero bytes,
/dev/(u)random as sources of random data, and
/dev/null just discards everything that's written into it.