Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have two ext3 lv's of 4GB and 10GB in my hda8 partition, and they are automounted by /dev/mapper/ in my /etc/mtab files in each of the four distros (Suse9.3, OpenSuse10.2, kubuntu7.04 and Debian Lenny 5.0.3). Since ext3 is a journalled fs I feel I ought to fsck their integrity every 3 months or so, however I don't know
a) whether they must be unmounted before running fsck,
b) whether I should use a live CD such as knoppix to run the fsck command, and
c) whether I can and/or should run fsck /dev/hda8, or whether I should somehow fsck each lv seperately?
Any experienced advice would be gratefully received. TIA
a) they must be unmounted or read-only mounted to fscked. you can remount but partition must not be getting used by anything.
b) see a), if you can do a) then you do not need to use live cd.
c) yes you need to fsck each lv separately.
well you don't use fsck to check a logical volume, you check the filesystem inside it. It makes no sense to use fsck against /dev/hda8 if that is an LVM partition, as there is no filesystem directly inside it.
If you wish to explicitly check them, you should be able to just reboot the machine and let it check them when it comes back up if they are filesystems which can not be unmounted before doing so. by using the tune2fs tool you can make the number of mounts between full checks, -c, be equal to the number of mounts experienced, -C, and on reboot it will force a check. In the long term you can also use the -i option to make it check every 90 days regardless of mounts, but obviously only at boot time, if there is one.
i) if it is sufficient to ('#') comment out the above quoted lines and then reboot, so that the lv's are not mounted, and
ii) if they are not mounted, presumably udev and device-mapper will still effectively create the /dev/mapper/* devices, should I run the command: # fsck /dev/mapper/xensys-xslv0 to achieve my aim?
i) if it is sufficient to ('#') comment out the above quoted lines and then reboot, so that the lv's are not mounted, and
ii) if they are not mounted, presumably udev and device-mapper will still effectively create the /dev/mapper/* devices, should I run the command: # fsck /dev/mapper/xensys-xslv0 to achieve my aim?
it will be okey. udev should create the related entries.
Hi. Can I dd my /dev/hda8 to my usb drive as a hda8.image on /dev/sdb3 to ensure that none of my data is obliterated in the meantime?
I am currently running Debian Lenny on a laptop so it gets booted most days - so I think I will follow your suggestion to let the boot process check the filesystem integrity of the lv's (I have disabled 'quiet' option in GRUB) so if it doesn't check the lv's in the next couple of months I will run tune2fs. Incidentally, is there any way to check the current settings (I see that there is a -T time-last-checked option for tune2fs) is this logged or stored anywhere (I see in my /var/log/boot today that the Debian /dev/hda6 was checked - it took up a couple of minutes for a 10GB partition - today [and the reason that I posed this question today] and that the file systems were checked (no files or blocks count) after LVM Volume Groups were set up.
So I guess I'll just let sleeping dogs lie and live by the adage 'if it ain't broke, don't fix it'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.