Sheel Raj | 1 Dec 2008 20:59
Picon

EXT3 filesystem data mode

Hi all

Here's my 2 questions about linux ext3 filesystem

1. How do I identify which data mode[writeback, ordered. journal] is
being used by the filesystem on my machine.
I checked /etc/fstab and /etc/log/messages and could not get any info
from there. I know 'tune2fs' can be used to set the modes, but I would
like to know which mode is it in, before setting up any.

2. In either of the data modes, which method or utility would you
suggest to secure erase/delete files and directories, so that they are
not recovered by any means.

Any reply, reference regarding my questions will be appreciated.
Thanks in advance

Sheel Raj
Bruno Wolff III | 1 Dec 2008 23:12
Picon

Re: EXT3 filesystem data mode

On Mon, Dec 01, 2008 at 14:59:31 -0500,
  Sheel Raj <sheelraj <at> gmail.com> wrote:
> Hi all
> 
> Here's my 2 questions about linux ext3 filesystem
> 
> 1. How do I identify which data mode[writeback, ordered. journal] is
> being used by the filesystem on my machine.
> I checked /etc/fstab and /etc/log/messages and could not get any info
> from there. I know 'tune2fs' can be used to set the modes, but I would
> like to know which mode is it in, before setting up any.

tune2fs -l device will show you the defaults. 
cat /proc/mounts will show you the mount options.

> 2. In either of the data modes, which method or utility would you
> suggest to secure erase/delete files and directories, so that they are
> not recovered by any means.

Use a rescue disk to boot without using the disks and write /dev/urandom
over the the raw device.
Pull out the disks and incinerate them.
Smash the remains up with a sledge hammer.
Be sure to get rid of any back ups you have and any people that know the
conents as well.
milos rovcanin | 2 Dec 2008 14:49
Picon

bit per bit copy! ext3

I have a flash memory stick that is formated with ext3 file system. NOw, there is an application on it that I would like to copy to another memory stick. I can copy it, but when I do so, that application does not work properly (it won't start - boot problem???).  Is there a tool that can copy an entire content from one flash stick to another? Thanks!!!

_______________________________________________
Ext3-users mailing list
Ext3-users <at> redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
Justin Piszcz | 2 Dec 2008 14:55

Re: bit per bit copy! ext3


On Tue, 2 Dec 2008, milos rovcanin wrote:

> I have a flash memory stick that is formated with ext3 file system. NOw,
> there is an application on it that I would like to copy to another memory
> stick. I can copy it, but when I do so, that application does not work
> properly (it won't start - boot problem???).  Is there a tool that can copy
> an entire content from one flash stick to another? Thanks!!!
>

use dd

dd if=/dev/sda of=/dev/sdb

or

# original flash
dd if=/dev/sda of=flash_disk.img
# with second flash flugged in
dd if=flash_disk.img of=/dev/sda

They must/should be the same sizes though.

Justin.
Alex Bligh | 2 Dec 2008 15:01
Picon

Re: bit per bit copy! ext3


--On 2 December 2008 08:55:17 -0500 Justin Piszcz <jpiszcz <at> lucidpixels.com> 
wrote:

># original flash
> dd if=/dev/sda of=flash_disk.img
># with second flash flugged in
> dd if=flash_disk.img of=/dev/sda
>
> They must/should be the same sizes though.

I believe if you are copying the whole of sda, a larger destination disk
will not be problematic.

Alex
Justin Piszcz | 2 Dec 2008 15:14

Re: bit per bit copy! ext3


On Tue, 2 Dec 2008, Alex Bligh wrote:

>
>
> --On 2 December 2008 08:55:17 -0500 Justin Piszcz <jpiszcz <at> lucidpixels.com> 
> wrote:
>
>> # original flash
>> dd if=/dev/sda of=flash_disk.img
>> # with second flash flugged in
>> dd if=flash_disk.img of=/dev/sda
>> 
>> They must/should be the same sizes though.
>
> I believe if you are copying the whole of sda, a larger destination disk
> will not be problematic.
>
> Alex
>

Alex, this is true but I have seen/done this before example:

80GB DD/Acronis => 500GB disk (albeit this was windows)..

It showed up as an 80 gigabyte disk/etc on the new hard drive even though 
it had additional capacity available.

So yeah it should work, just don't count on being able to use the space, 
in my case/example there was an encryption/disk product involved and dd 
was the only way to move the data and if you tried to expand the partition 
inside of the encryption product it would crash the machine/windows would 
not boot correctly, etc.

Justin.
Alex Bligh | 2 Dec 2008 15:49
Picon

Re: bit per bit copy! ext3


--On 2 December 2008 09:14:17 -0500 Justin Piszcz <jpiszcz <at> lucidpixels.com> 
wrote:

> 80GB DD/Acronis => 500GB disk (albeit this was windows)..
>
> It showed up as an 80 gigabyte disk/etc on the new hard drive even though
> it had additional capacity available.

Yes, that's what will happen. dd will not of itself expand the filesystem
to match the available space. If the device is partitioned, you
may be able to just copy the partition and be left with some
free space.

Alex
Stephen Samuel | 2 Dec 2008 17:21
Picon

Re: bit per bit copy! ext3

I think, however, that you should actually copy /dev/sda1, to /dev/sdba1 not /dev/sda. to /dev/sdb
If you copy /dev/sda1, you will also copy the partition table.  If your flash drives are different sizes you might end up with problems.

another solution would be, especially if you are making an intermediate copy on your hard drive, to use partimage.  Partimage will only copy the sectors on the partition that are actually in use.. thus saving both disk space and time for the copy process.

On Tue, Dec 2, 2008 at 5:55 AM, Justin Piszcz <jpiszcz <at> lucidpixels.com> wrote:


On Tue, 2 Dec 2008, milos rovcanin wrote:

I have a flash memory stick that is formated with ext3 file system. NOw,
there is an application on it that I would like to copy to another memory
stick. I can copy it, but when I do so, that application does not work
properly (it won't start - boot problem???).  Is there a tool that can copy
an entire content from one flash stick to another? Thanks!!!


use dd

dd if=/dev/sda of=/dev/sdb

or

# original flash
dd if=/dev/sda of=flash_disk.img
# with second flash flugged in
dd if=flash_disk.img of=/dev/sda

They must/should be the same sizes though.

Justin.

_______________________________________________
Ext3-users mailing list
Ext3-users <at> redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users



--
Stephen Samuel http://www.bcgreen.com
778-861-7641
_______________________________________________
Ext3-users mailing list
Ext3-users <at> redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
Chris Worley | 3 Dec 2008 00:28
Picon

Block Discard (Was Re: When is a block free?)

I'm noticing in the latest 2.6.28 pre-patches at kernel.org, ext4 has a call to sb_issue_discard, but the call that was in David Woodhouse's ext2 branch is gone.  Will only ext4 support "discards" going forward?

Thanks,

Chris

On Wed, Oct 1, 2008 at 11:18 AM, Chris Worley <worleys <at> gmail.com> wrote:
On Mon, Sep 29, 2008 at 10:39 AM, Theodore Tso <tytso <at> mit.edu> wrote:
> On Mon, Sep 29, 2008 at 09:24:33AM -0600, Chris Worley wrote:
>> On Tue, Sep 16, 2008 at 3:32 PM, Chris Worley <worleys <at> gmail.com> wrote:
>> > For example, in balloc.c I'm seeing ext3_free_blocks_sb
>> > calls ext3_clear_bit_atomic at the bottom... is that when the block is
>> > freed?  Are all blocks freed here?
>>
>> David Woodhouse, in an article at http://lwn.net/Articles/293658/, is
>> implementing the T10/T13 committees "Trim" request in 2.6.28 kernels.
>>
>> Would it be appropriate to call "blkdev_issue_discard" at the bottom
>> of ext3_free_blocks_sb where ext3_clear_bit_atomic is being called?
>
> Unfortunately, it's not as simple as that.  The problem is that as
> soon as you call trim, the drive is allowed to discard the contents of
> that block so that future attempts to read from that block returns all
> zeros.  Therefore we can't call Trim until after the transaction has
> committed.  That means we have to keep a linked list of block extents
> that are to be trimmed attached to the commit object, and only send
> the trim requests once the commit block has been written to disk.
>
> It's on the ext4 developer's TODO list to add Trim support to ext3 and
> ext4.

I was perusing David Woodhouse's 2.6.27-rc2 kernel at
git://git.infradead.org/users/drzeus/discard-2.6.git, and noticed he
has the discard built-in to where I was talking about for ext2... so I
coded our driver to handle discards, and it works very nicely!!!

The journaling issue you raise is not a show-stopper on the block
device side: if the block device has to maintain a couple of blocks
that are not really in use, it's no big deal (eventually the blocks
will be re-written and the universe will be in order again)... for the
users, I can understand if the discard is preserved on the block
device, while the fs still thinks there's good data in there (we'll
give you back all zeros on read).

Chris

_______________________________________________
Ext3-users mailing list
Ext3-users <at> redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
Knops, Manfred | 10 Dec 2008 10:53
Favicon

unmeant redundant partitions

Hello,

it's the first time for me to use a mailing group. So I hope it's the
right place.
At the moment I installed opensuse 11.0 on a machine with two harddiscs
and one raid system with adaptec raid controller.
I have installed linux on one harddisc before I build the raid
combination. After that I rebooted the machine.
At this moment the device id's changed. Now I have following harddisc's:

fileserver:~ # fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util
fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 8996.8 GB, 8996872257536 bytes
255 heads, 63 sectors/track, 1093807 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      267350  2147483647+  ee  EFI GPT

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2e2e2e2e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1045     8393931   82  Linux swap / Solaris
/dev/sdb2   *        1046       30401   235802070    f  W95 Ext'd (LBA)
/dev/sdb5            1046        2351    10490413+  83  Linux
/dev/sdb6            2352        3004     5245191   83  Linux
/dev/sdb7            3005       30401   220066371   83  Linux

Disk /dev/sdc: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2e2e2e2e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1045     8393931   82  Linux swap / Solaris
/dev/sdc2   *        1046       30401   235802070    f  W95 Ext'd (LBA)
/dev/sdc5            1046        2351    10490413+  83  Linux
/dev/sdc6            2352        3004     5245191   83  Linux
/dev/sdc7            3005       30401   220066371   83  Linux

Disk /dev/dm-0: 161.0 GB, 161037403136 bytes
255 heads, 63 sectors/track, 19578 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Most time I use partition labels to mount the partitions. I can't
remember why. But the partitions of sdb and sdc have the same labels:
fileserver:~ # !for
for device in sdb5 sdc5 sdb6 sdc6 sdb7 sdc7; do tune2fs -l
/dev/${device} | grep "Filesystem volume name"; done
Filesystem volume name:   rootOnSdb
Filesystem volume name:   rootOnSdb
Filesystem volume name:   tmpOnSdb
Filesystem volume name:   tmpOnSdb
Filesystem volume name:   varOnSdb
Filesystem volume name:   varOnSdb

sdb is the default disc for linux. sdc should be a spare part. So this
is the mount table:
fileserver:~ # mount
/dev/sdb5 on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sdb6 on /tmp type ext3 (rw,acl,user_xattr)
/dev/sdb7 on /var type ext3 (rw,acl,user_xattr)
/dev/sda1 on /fileserverShare type ext3 (rw,acl,user_xattr)
/dev/sda2 on /backup type ext3 (rw,acl,user_xattr)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
proc on /var/lib/ntp/proc type proc (ro)
/dev/mapper/cr_sda3 on /home type ext3 (rw,acl,user_xattr)

Now I will show you what I have found.
1. I touched a file on /root. / is the mountpoint of /dev/sdb5. So the
file must be storage on /dev/sdb5.
fileserver:~ # date
Mi 10. Dez 10:34:03 CET 2008
fileserver:~ # echo `date` >> /root/foo.bar
fileserver:~ # ls -l /root/foo.bar
-rw-r--r-- 1 root root 29 2008-12-10 10:34 /root/foo.bar
fileserver:~ # cat /root/foo.bar
Mi 10. Dez 10:34:19 CET 2008
fileserver:~ #

2. I mount /dev/sdc5 to /local/sdc/
fileserver:~ # mount -v /local/sdc/
/dev/sdc5 on /local/sdc type ext3 (rw,acl,user_xattr)

3. I list the entry of /local/sdc/root/
fileserver:~ # ls -l /local/sdc/root/
total 92
-rw------- 1 root root 13431 2008-12-10 10:03 .bash_history
drwxr-xr-x 2 root root  4096 2008-12-09 13:00 bin
-rw-r--r-- 1 root root  1332 2005-11-23 17:06 .exrc
-rw-r--r-- 1 root root    29 2008-12-10 10:34 foo.bar
drwx------ 2 root root  4096 2008-12-05 11:47 .gnupg
drwxr-xr-x 6 root root  4096 2008-12-05 10:56 inst-sys
drwxr-xr-x 2 root root  4096 2008-12-05 11:20 .kbd
drwxr-xr-x 2 root root  4096 2008-12-08 10:09 ldap_datenbank_sicherung
-rw-r--r-- 1 root root    57 2008-12-08 16:32 .ldaprc
-r-------- 1 root root   102 2008-12-09 11:17 Liesmich.txt
drwx------ 2 root root  4096 2008-12-05 11:33 .ssh
-rw-r--r-- 1 root root 20859 2008-12-05 11:34 .suse_register.log
-rw------- 1 root root  9526 2008-12-10 09:44 .viminfo
-rw------- 1 root root     0 2008-12-09 13:31 .Xauthority
fileserver:~ # cat /local/sdc/root/foo.bar
Mi 10. Dez 10:34:19 CET 2008

At this moment I was confused about the existing file foo.bar under
/local/sdc/.
Because I can't explain why it exists. First I think there was an error
on my side.
So I delete /local/sdc/root/foo.bar.
fileserver:~ # rm -vf /local/sdc/root/foo.bar
removed `/local/sdc/root/foo.bar'
fileserver:~ #                            
fileserver:~ # ls -l /local/sdc/root
total 88
-rw------- 1 root root 13431 2008-12-10 10:03 .bash_history
drwxr-xr-x 2 root root  4096 2008-12-09 13:00 bin
-rw-r--r-- 1 root root  1332 2005-11-23 17:06 .exrc
drwx------ 2 root root  4096 2008-12-05 11:47 .gnupg
drwxr-xr-x 6 root root  4096 2008-12-05 10:56 inst-sys
drwxr-xr-x 2 root root  4096 2008-12-05 11:20 .kbd
drwxr-xr-x 2 root root  4096 2008-12-08 10:09 ldap_datenbank_sicherung
-rw-r--r-- 1 root root    57 2008-12-08 16:32 .ldaprc
-r-------- 1 root root   102 2008-12-09 11:17 Liesmich.txt
drwx------ 2 root root  4096 2008-12-05 11:33 .ssh
-rw-r--r-- 1 root root 20859 2008-12-05 11:34 .suse_register.log
-rw------- 1 root root  9526 2008-12-10 09:44 .viminfo
-rw------- 1 root root     0 2008-12-09 13:31 .Xauthority

The file doesn't exist anymore on /local/sdc/root/.
Now I check /root.
fileserver:~ # ls -l /root/
total 88
-rw------- 1 root root 13431 2008-12-10 10:03 .bash_history
drwxr-xr-x 2 root root  4096 2008-12-09 13:00 bin
-rw-r--r-- 1 root root  1332 2005-11-23 17:06 .exrc
drwx------ 2 root root  4096 2008-12-05 11:47 .gnupg
drwxr-xr-x 6 root root  4096 2008-12-05 10:56 inst-sys
drwxr-xr-x 2 root root  4096 2008-12-05 11:20 .kbd
drwxr-xr-x 2 root root  4096 2008-12-08 10:09 ldap_datenbank_sicherung
-rw-r--r-- 1 root root    57 2008-12-08 16:32 .ldaprc
-r-------- 1 root root   102 2008-12-09 11:17 Liesmich.txt
drwx------ 2 root root  4096 2008-12-05 11:33 .ssh
-rw-r--r-- 1 root root 20859 2008-12-05 11:34 .suse_register.log
-rw------- 1 root root  9526 2008-12-10 09:44 .viminfo
-rw------- 1 root root     0 2008-12-09 13:31 .Xauthority
The file foo.bar doesn't exist anymore here. But why?

Can someone explain me what happens  on this machine?

Regards
Manfred

Gmane