LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-30-2009, 04:35 PM   #1
kap4lin
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Rep: Reputation: 0
shred on ext3 partition - journaled or not?


I've an ext3 partition /dev/sda7 and I want to know with what journaling options this was mounted: (because I want to use shred on it)

fstab entry:
Code:
UUID=......       /media/sda7     ext3    defaults        0       2
mtab entry:
Code:
/dev/sda7 /media/sda7 ext3 rw 0 0
tune2fs -l /dev/sda7 shows (only relevant parts shown)
Code:
Filesystem features:      has_journal ext_attr resize_inode dir_index
filetype needs_recovery sparse_super large_file
Default mount options:    (none)
Journal inode:            8
Default directory hash:   half_md4
Journal backup:           inode blocks
So, is this mounted with data=journal / data=ordered / data=writeback?
More importantly Is there any way to verify what journaling mode is
used on this (or any other) partition? The reason I ask is that shred
(man shred) is not reliable on data=journal mode.
 
Old 01-30-2009, 05:17 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
My experience is that shred works fine on partitions with journaling. My understanding is that it doesn't work well on files within journaled partitions.

So I just unmount the partition and then do shred -z -v -n 3 /dev/sda7. I've tried recovery using foremost and photorec at different times and wasn't able to get anything back. Though that's hardly a scientific guarantee...
 
Old 01-30-2009, 05:36 PM   #3
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Default ext3 journaling mode is ordered,meaning that it only log changes to filesystem metadata but flushes file data updates to disk before making changes to filesystem metadata.If you haven't changed default settings then that's the mode you have.All three modes can be activated and deactivated in /etc/fstab entry for ext3 filesystem.To change it do,for example;
Code:
/dev/hda1     /opt       ext3       data=writeback        1 0
in /etc/fstab entry if you would like to have writeback mode,which I do not recommend because it's a high risk mode.

Last edited by alan_ri; 01-30-2009 at 05:44 PM. Reason: adding info
 
Old 01-30-2009, 05:38 PM   #4
kap4lin
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pljvaldez View Post
My experience is that shred works fine on partitions with journaling. My understanding is that it doesn't work well on files within journaled partitions.
Actually, I am interested in shredding some files and not the whole partition, sorry for the miscommunication. But it is good to know how it works on the whole partition. So, any way to identify/verify the journaling mode on a partition?

Thanks
 
Old 01-30-2009, 05:48 PM   #5
kap4lin
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by alan_ri View Post
Default ext3 journaling mode is ordered,meaning that it only log changes to filesystem metadata but flushes file data updates to disk before making changes to filesystem metadata.If you haven't changed default settings then that's the mode you have.
Ah, the default is ordered, so shred should work as expected? Still, is there any way to verify it on a mounted partition? I guess what I am looking for is a command something like: "command /dev/sda7" which gives all the mount options used when mounting this partition, explicitly, wherein I can see the journaled mode. Thanks again.
 
Old 01-30-2009, 08:18 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,176

Rep: Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346
"grep -i data= /proc/mounts"
 
Old 01-31-2009, 01:22 AM   #7
kap4lin
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Solved

Quote:
Originally Posted by syg00 View Post
"grep -i data= /proc/mounts"
Thats exactly what I was looking for. Thanks

Last edited by kap4lin; 01-31-2009 at 01:23 AM. Reason: Add "solved"
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shred entire device or partition , remove file system first? writedom Linux - Newbie 8 05-26-2008 12:32 PM
Looking for light, automated shred/partition/format utility Aud1073cH Linux - Newbie 2 04-26-2007 12:21 PM
crypto, "shred", ext3, and loop device expaand Linux - Security 8 06-26-2006 07:46 AM
single ext3 journal device multiple journaled file systems? reelwylde Linux - General 4 09-08-2005 03:00 PM
shred program for ext3 elconde Linux - Software 4 11-24-2003 06:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:26 AM.

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