TransWikia.com

fsck (or e2fsck) - Example of difference between -p and -y options

Ask Ubuntu Asked on March 1, 2021

Looking at the manual for e2fsck, there are two options that appear very similar:

e2fsck -y (which answers ‘yes’ to any question answered)

e2fsck -p (which does not ask any questions, and just goes ahead and does whatever it thinks best)

I found this older thread which seems to confirm the above:

https://unix.stackexchange.com/questions/132803/what-is-the-difference-between-fsck-options-y-and-p?newreg=1a2c41a3eb4b4086a5d5fb88bc74d813

Whilst I can see the difference, I don’t understand the practical impact it might have.

Can someone give me an example of where an Ubuntu system (assume Ubuntu 20.04 LTS if it makes a difference) would do something different if using the -y versus -p options?

The reason for asking is that I have a system that I am trying to bring up a disk on (to copy data off) and I am trying to run:

fsck -pvcf /dev/id

The system is telling me that it cannot run automatically, and needs to be run ‘manually’ without the -p option. The problem is that this generated thousands of confirmations (I gave up holding down the ‘enter’ key and did a Ctrl-C), so I figured I would see if:

e2fsck -yvcf /dev/id

would work, but then wondered what the difference might be, and would there be a downside.

For the avoidance of doubt, I have a ddrescue ‘image’ of the drive already (I told it to ignore errors and do the best it can), so no real risk of making things any worse – I am mainly just playing around to learn and see what I can achieve with fsck at this point.

Thanks,

Alan.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP