Mount/fstab Question . . .

Greetings!

Got another basic question for the community :slight_smile:

After wiping a drive with dd , and calling mkfs.ext4 to set things up again, fstab seems to need to be refreshed somehow to allow a call to mount for the volume.

What might the "secret handshake" be to pull this off without first pulling the drive out???

Thanks --

Yes, you will have to edit /etc/fstab to add or change the entry for your new filesystem. Are you getting an error when you try:

mount -t ext4 /dev/something /mnt
1 Like

You do need to explicitly remount the file system with a proper mount command. It won't magically remount itself.

mount(8): mount filesystem - Linux man page

@derekludwig:

You got me moving in the right direction.

In the end,

mount -t ext4 /dev/sdb1 /mnt/usb

turned the nut on my end :wink:

Comically, I tried

mount -t ext4 /dev/sdb1 /dev

and watched all of the unmounted filesystems completely disappear (even GParted and TestDisk protested)! Rudely killed everything and rebooted to Parted Magic; only to see that all was still there, and happy as normal...

Any comments/insights on what might've happened?

Thanks again --

Hi,

Mounting a file system on a directory causes all below the directory to vanish until the file system is unmounted - not that easy when you have no device tree (/dev)

Regards

Dave

1 Like

That is pretty funny :slight_smile:

/dev/ is folder where device files are kept -- the files UNIX/Linux need to access, among other things, disks. You opened your new partition overtop of that, blocking them all. (Kind of like setting a blank sheet of paper atop a written one; the stuff beneath still exists, but you don't see it.) Things already open won't be affected, but you won't be able to open anything else. This has wider effects than disks. You probably lost the ability to create new terminals too, as well as sound, mice, even the bit-bucket, anything which is a character or block device.

You might have been able to recover from that with umount /dev but a reboot is good too.

1 Like

@gull04 and Corona688:

Thanks for the insight.

That was one heck of a prank if you ask me :eek:

Cheers!