# External hard drive's filesystem; laptop_mode?

## kukibl

1. First question is not Gentoo specific, but since Gentoo users are quite technical, I would really appreciate your opinion.

Recently I bought WesternDigital 1 TB external hard drive (connecting it through USB port). I use Linux exclusively and planning to use this disk as backup solution - stage 4 from time to time and /home data, also to free up my laptop's (only have laptop) disk space from some things I don't need that much.

1.1 Which filesystem would suit best? I really don't plan to take my hdd with me, to share data with other computers, so I'm not that much in need of Windows' filesystem (NTFS or FAT32), but again you never know. I thought to make 2 partition, maybe one 100 GB NTFS and the rest I would format with some Linux filesystem. I read a lot of nice things concerning JFS, but also used reiserfs for 4-5 years and have really nice experience with it. Once again, main purpose is backup. What do you think?

1.2 I want to make things quite easy, so I am thinking of using some sync. tool. By Google-ing I saw that lots of people use rsync, but want to read your opinion.

2. Found this guide on Gentoo docs concerning power management http://www.gentoo.org/doc/en/power-management-guide.xml. Already knew CPU freq. scaling stuff, but to be honest - don't know much about HDD power saving. Decided to use laptop_mode. The things that concerns me: when on battery I can hear "clicks" quite often. I remember reading that HDD spindown have negative effect of HDD health. Also, quite logical my system become less responsive. In example, while typing this message I have impression like the system is under heavy load (only FF and konsole opened), letters are a little bit late etc.

On battery:

```
cat /proc/sys/vm/laptop_mode

2

```

Value is 0 on ac.

I believe I can use sysctl to set this value to 1, maybe then it will be less aggressive. What do you think? Or to use hdparm tip instead?

I would really appreciate if you could take a look at my laptop_mode.conf, just to check if there is something strange.

http://pastebin.com/m4be5581e

Thank you very much for your time!

----------

## Veldrin

1.1 Filesystems

As your main concern is data safety, I would go with rather stable FS: ext3. (ext4 is to immature)

But as opinions vary, and I do not have any experience with jfs - I cannot give any recommendation.

XFS might be an alternative, though it's advantage lies with large file. Using a "backup-tool" which creates a large file, this might be the way to go.

I would avoid reiserfs - I do not have any negative experience - but known to cause FS corruption, and its advantage lies with small files.

I short: depending on the backup method, use either XFS, ext3 or JFS.

1.2 Backup Tool

I use rsync for backup, and I basically run a one line command. I provides a simple way to perform differential and incremental backups.

What is needed in addition, would be some kind of cleanup tool, to remove old (stale) backups. But I think a cronjob should do the trick.

cheers

V.

----------

## DawgG

as filesystem, i recommend ext3 or ext4. it's not the fanciest  :wink: but stable and widely supported. i think just for personal backups xfs/jfs is too much and reiserfs development has ceased.

you can reserve a little space for shitty filesystems like ntfs and fat in case you ever have to use some legacy os.

if you know that you will have root access to most of the boxes your harddrive will be connected to you can use disk-encryption with luks so you data is safe when you lose the drive.

for backup i like to use rsnapshot in cases like this, it's a perl-script that uses rsync. you can have a flexible number of daily (even hourly), weekly and monthly snapshots and you can do backups over the network (with ssh). 

about the energy-saving stuff i don't know much - sorry.

GOOD LUCK!

----------

## kukibl

Thank you for your answers! I'll propably put ext3, however one thing is bothering me - how much partition space will it keep? I am not sure how to express myself (technical expression), but I noticed that if I format partition with reiserfs it will be bigger than the partition of the same size formated with ext3. In example (random values):

10 GB raw partition:

--> 9.5 GB reiserfs formated

--> 9 GB ext3 formated.

So in the end, if I decide to make one 900 GB partition, after I format it with ext3, what will be it's final size?

Ok, rsnapshot looks interesting, so I'll definitely check it.

Also, any help concering laptop_mode is welcome. Laptop users? Currently it is disabled.

----------

## Veldrin

you forget, that ext3 (ext2 and ext4 too) reserve 5% for root. this can be avoided with -m0 in mkfs.ext3 or tune2fs.

----------

## kukibl

In the end:

1 TB=

--> 950 GB raw partition formated with ext3 (passed -m0 option) = 872 GB

-->   50 GB raw partition formated with ntfs = 47 GB

That is it, now going to read carefully rsnapshot tutorial.  :Smile: 

Thank you once again!

Edit:

Strange problem... Ext3 partition (sdb1) is read-only by normal user, but NTFS one (sdb2) is writable. User is member of usb and plugdev groups.

Dmesg output:

```

[  411.363876] scsi 4:0:0:0: Direct-Access     WD       10EADS External  1.75 PQ: 0 ANSI: 4

[  411.366513] sd 4:0:0:0: Attached scsi generic sg2 type 0

[  411.368231] sd 4:0:0:0: [sdb] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB)

[  411.368829] sd 4:0:0:0: [sdb] Write Protect is off

[  411.368844] sd 4:0:0:0: [sdb] Mode Sense: 23 00 00 00

[  411.368855] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[  411.371197] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[  411.371211]  sdb: sdb1 sdb2

[  411.382603] sd 4:0:0:0: [sdb] Attached SCSI disk

[  419.748946] kjournald starting.  Commit interval 5 seconds

[  419.749972] EXT3 FS on sdb1, internal journal

[  419.749981] EXT3-fs: mounted filesystem with writeback data mode.

[  477.462949] fuse init (API version 7.11)

[  912.415180] kjournald starting.  Commit interval 5 seconds

[  912.416767] EXT3 FS on sdb1, internal journal

[  912.416774] EXT3-fs: mounted filesystem with writeback data mode.

```

```

$mount -l

/dev/sdb2 on /media/disk-1 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)

/dev/sdb1 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal)

```

How to fix this?

Edit 2:

Temporary fixed - I chown-ed mounted directory (/media/disk in this case), but it's a "dirty" solution. Would like to know how to make HAL mount it automatically with writable persmissions (just like any other external storage device)?

----------

## GoldenMouse

I'm seeing the same thing.  Just got a 1TB WD external hard drive.  Immediately wiped the NTFS formatting that it came with, created a single, new partition, and formatted that with ext4.  When I pop in its usb cable, Gnome mounts it just like a FAT flash drive, but is read-only to everyone but root.  A chown or chmod would fix this easily, but I'm looking for a clean solution.  So, I have two questions about all of this.

First, do those FAT-formatted flash drives mount read/write for any given user because FAT is just like that, whereas ext4 is pickier?

Second, what is the cleanest solution to getting it to mount read/write for any given user and system?  I suppose I could reformat it into FAT, but I'd like to have a better file-system if possible.

----------

## GoldenMouse

OK, so FAT32 is much more permissive and the likely reason why most flash disks are more promiscuous.  So, it works now as intended, but I cringe to think of what I did to the poor thing, putting such an old, crusty fs on there.

----------

