LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 01-10-2010, 05:00 PM   #1
minrich
Member
 
Registered: Aug 2003
Location: Isles of Man & Wight
Distribution: See signature
Posts: 548

Rep: Reputation: 40
Wanted safe way to fsck (mounted) LVM partition


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
 
Old 01-10-2010, 05:11 PM   #2
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
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.
 
Old 01-10-2010, 05:17 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 01-10-2010, 05:28 PM   #4
minrich
Member
 
Registered: Aug 2003
Location: Isles of Man & Wight
Distribution: See signature
Posts: 548

Original Poster
Rep: Reputation: 40
I currently have the following two lines in my /etc/mtab:

/dev/mapper/xensys-xslv0 /mnt/xslv0 ext3 rw 0 0
/dev/mapper/xensys-xslv1 /mnt/xslv1 ext3 rw 0 0

I currently have the following in my /etc/fstab:

/dev/mapper/xensys-xslv0 /mnt/xslv0 ext3 nouser,atime,auto,rw,dev,exec,suid 0 0
/dev/mapper/xensys-xslv1 /mnt/xslv1 ext3 nouser,atime,auto,rw,dev,exec,suid 0 0

Do you know

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?
 
Old 01-10-2010, 05:31 PM   #5
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by minrich View Post
Do you know

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.
 
Old 01-10-2010, 06:06 PM   #6
minrich
Member
 
Registered: Aug 2003
Location: Isles of Man & Wight
Distribution: See signature
Posts: 548

Original Poster
Rep: Reputation: 40
@chris

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'.

Thanks for the responses
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What the fsck? How to check a partition that is mounted as readonly? gr4nt Linux - Newbie 12 01-18-2010 04:57 AM
Creating an LVM Volume Group with a mounted ext3 partition alexpacio Linux - Software 1 11-09-2008 02:44 PM
RHEL fsck guidance wanted rajsrmc Red Hat 5 05-07-2008 09:55 AM
Assistance using fsck to recover ext3 LVM partition fiberfarm Fedora 1 11-01-2006 08:49 PM
FSCK on mounted partition xdiman Linux - Software 3 12-05-2005 01:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration